From 39c6287d5c014d5511d35bbbab14615c2198f369 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 18:03:47 +0000 Subject: [PATCH] Bump modernc.org/sqlite from 1.29.9 to 1.29.10 Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.9 to 1.29.10. - [Commits](https://gitlab.com/cznic/sqlite/compare/v1.29.9...v1.29.10) --- updated-dependencies: - dependency-name: modernc.org/sqlite dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../sqlite/lib/sqlite_darwin_amd64.go | 226 +- .../sqlite/lib/sqlite_darwin_arm64.go | 226 +- .../sqlite/lib/sqlite_freebsd_amd64.go | 221 +- .../sqlite/lib/sqlite_freebsd_arm64.go | 221 +- .../sqlite/lib/sqlite_linux_386.go | 221 +- .../sqlite/lib/sqlite_linux_amd64.go | 5009 +++++++++-------- .../sqlite/lib/sqlite_linux_arm.go | 221 +- .../sqlite/lib/sqlite_linux_arm64.go | 221 +- .../sqlite/lib/sqlite_linux_loong64.go | 225 +- .../sqlite/lib/sqlite_linux_ppc64le.go | 221 +- .../sqlite/lib/sqlite_linux_riscv64.go | 221 +- .../sqlite/lib/sqlite_linux_s390x.go | 221 +- .../modernc.org/sqlite/lib/sqlite_windows.go | 222 +- vendor/modules.txt | 2 +- 16 files changed, 5062 insertions(+), 2622 deletions(-) diff --git a/go.mod b/go.mod index a2db2a5b13..85210b49a5 100644 --- a/go.mod +++ b/go.mod @@ -63,7 +63,7 @@ require ( gorm.io/driver/sqlite v1.5.5 gorm.io/gorm v1.25.10 gvisor.dev/gvisor v0.0.0-20240306221502-ee1e1f6070e3 - modernc.org/sqlite v1.29.9 + modernc.org/sqlite v1.29.10 tailscale.com v1.64.2 ) diff --git a/go.sum b/go.sum index 85e2c147bb..15085e73d4 100644 --- a/go.sum +++ b/go.sum @@ -614,8 +614,8 @@ modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= -modernc.org/sqlite v1.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow= -modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= +modernc.org/sqlite v1.29.10 h1:3u93dz83myFnMilBGCOLbr+HjklS6+5rJLx4q86RDAg= +modernc.org/sqlite v1.29.10/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go index ba18b9777e..92e794af35 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go @@ -1,4 +1,4 @@ -// Code generated for darwin/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for darwin/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build darwin && amd64 // +build darwin,amd64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -15775,6 +15773,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -15843,6 +15842,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -20804,6 +20804,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -22543,6 +22544,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -23438,6 +23440,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -23543,6 +23546,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -28261,6 +28265,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -28419,6 +28424,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -29231,6 +29237,7 @@ func _afpLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) } } + goto afp_end_lock afp_end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -30491,6 +30498,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -30632,6 +30640,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -32103,6 +32112,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -32893,6 +32903,7 @@ func _proxyCreateUnixFile(tls *libc.TLS, path uintptr, ppFile uintptr, islockfil *(*uintptr)(unsafe.Pointer(ppFile)) = pNew return SQLITE_OK } + goto end_create_proxy end_create_proxy: ; _robust_close(tls, pNew, fd, int32(45315)) @@ -32987,6 +32998,7 @@ func _proxyBreakConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr) (r int _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(45418)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) + goto end_breaklock end_breaklock: ; if rc != 0 { @@ -33210,6 +33222,7 @@ func _proxyTakeConch(tls *libc.TLS, pFile uintptr) (r int32) { } } (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(conchFile)).FpMethod)).FxUnlock})))(tls, conchFile, int32(SHARED_LOCK)) + goto end_takeconch end_takeconch: ; if rc == SQLITE_OK && (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags != 0 { @@ -35002,6 +35015,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -35270,6 +35284,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -35298,6 +35313,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -35530,6 +35546,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -36769,7 +36786,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -37290,7 +37307,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -40787,6 +40804,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -41114,6 +41132,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -43039,6 +43058,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -43436,6 +43456,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -43601,6 +43622,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -44483,6 +44505,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -46883,6 +46906,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -46929,6 +46953,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -56107,6 +56141,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -56265,6 +56300,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -56400,6 +56436,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -56991,6 +57028,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -57143,6 +57181,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -58155,6 +58194,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -59218,6 +59258,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -59902,6 +59943,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -60474,6 +60516,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -61322,6 +61365,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+5109, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -61486,6 +61530,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -62604,6 +62649,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -64041,6 +64087,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -64207,6 +64254,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -64882,6 +64930,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -65258,6 +65307,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -68675,6 +68725,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -68840,6 +68891,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -69857,6 +69909,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -69954,6 +70007,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -70329,6 +70383,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -70711,6 +70766,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -71437,6 +71493,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -71586,6 +71643,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -72910,6 +72968,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -72923,6 +72982,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadPInt32(db+432) != 0 { @@ -73009,6 +73069,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -73622,6 +73683,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -73674,6 +73736,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -73713,6 +73776,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -74580,6 +74644,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -74706,6 +74771,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -74843,9 +74909,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -74952,6 +75020,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+6014, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -75915,6 +75984,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -76351,6 +76421,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -76456,6 +76527,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -76768,6 +76840,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -77536,6 +77609,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -79657,6 +79731,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -79688,6 +79763,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -79706,6 +79782,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5771, 0) @@ -79713,6 +79790,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -79722,6 +79800,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -80117,6 +80196,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -85034,6 +85114,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -88829,6 +88910,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -90805,11 +90887,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -91333,6 +91417,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -92417,6 +92502,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -92622,6 +92708,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -93577,6 +93664,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -94177,6 +94265,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10267, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94419,6 +94508,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94535,6 +94625,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10267, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -95672,6 +95763,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -96187,6 +96279,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11594, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -96351,6 +96444,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -97103,6 +97197,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.X__builtin___memset_chk(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero), libc.X__builtin_object_size(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -98853,6 +98948,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -98933,6 +99029,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -98987,6 +99084,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -101064,6 +101162,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -101622,6 +101721,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -101770,9 +101870,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13407, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -102943,6 +103045,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -103483,6 +103586,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103646,6 +103750,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -104410,6 +104515,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -104595,6 +104701,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -105053,6 +105160,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -107056,6 +107164,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15557) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -107718,11 +107827,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -109026,10 +109137,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -139159,6 +139292,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141625,6 +141759,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142500,6 +142635,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -147987,6 +148123,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148567,6 +148704,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22951, -int32(1)) @@ -149792,6 +149930,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -164895,8 +165034,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -164908,7 +165045,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -164968,7 +165105,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.X__builtin___memset_chk(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184), libc.X__builtin_object_size(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0)) _sqlite3RegisterBuiltinFunctions(tls) @@ -164984,7 +165121,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165009,7 +165146,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165024,10 +165161,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165075,7 +165212,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171614,6 +171756,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172266,6 +172409,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -172420,6 +172564,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172546,6 +172691,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -172663,6 +172809,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -172740,6 +172887,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -172798,6 +172946,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -173334,6 +173483,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -174170,6 +174320,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174288,10 +174439,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25331, -int32(1)) @@ -174501,6 +174654,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174589,6 +174743,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -174678,6 +174833,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -174688,6 +174844,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+25331, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175026,6 +175183,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175393,9 +175551,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175505,6 +175665,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176595,6 +176756,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -179891,6 +180053,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180496,6 +180659,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181044,6 +181208,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182028,6 +182193,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182535,6 +182701,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -182638,8 +182805,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.X__builtin___memcpy_chk(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4), libc.X__builtin_object_size(tls, pBBox+4, 0)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183266,6 +183433,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183406,6 +183574,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183554,6 +183723,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -183836,6 +184006,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -185968,6 +186139,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186407,6 +186579,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -190912,6 +191085,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191002,6 +191176,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193472,6 +193647,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -193960,6 +194136,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196089,6 +196266,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -203610,6 +203788,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -203742,6 +203921,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -203948,6 +204128,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -209451,6 +209632,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -209813,6 +209995,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -209844,6 +210027,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211048,6 +211232,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -211265,6 +211450,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -217391,6 +217577,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -221136,6 +221323,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -221197,6 +221385,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -221222,6 +221411,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -221968,6 +222158,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) @@ -228935,3 +229126,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go index 870ef46f0e..4c77111415 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go @@ -1,4 +1,4 @@ -// Code generated for darwin/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for darwin/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build darwin && arm64 // +build darwin,arm64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -15363,6 +15361,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -15431,6 +15430,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -20392,6 +20392,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -22131,6 +22132,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -23026,6 +23028,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -23131,6 +23134,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -27816,6 +27820,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27974,6 +27979,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -28786,6 +28792,7 @@ func _afpLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) } } + goto afp_end_lock afp_end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -30046,6 +30053,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -30187,6 +30195,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -31658,6 +31667,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -32448,6 +32458,7 @@ func _proxyCreateUnixFile(tls *libc.TLS, path uintptr, ppFile uintptr, islockfil *(*uintptr)(unsafe.Pointer(ppFile)) = pNew return SQLITE_OK } + goto end_create_proxy end_create_proxy: ; _robust_close(tls, pNew, fd, int32(45315)) @@ -32542,6 +32553,7 @@ func _proxyBreakConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr) (r int _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(45418)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) + goto end_breaklock end_breaklock: ; if rc != 0 { @@ -32765,6 +32777,7 @@ func _proxyTakeConch(tls *libc.TLS, pFile uintptr) (r int32) { } } (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(conchFile)).FpMethod)).FxUnlock})))(tls, conchFile, int32(SHARED_LOCK)) + goto end_takeconch end_takeconch: ; if rc == SQLITE_OK && (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags != 0 { @@ -34557,6 +34570,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -34825,6 +34839,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -34853,6 +34868,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -35085,6 +35101,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -36324,7 +36341,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -36845,7 +36862,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -40342,6 +40359,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -40669,6 +40687,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -42594,6 +42613,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -42991,6 +43011,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -43156,6 +43177,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -44038,6 +44060,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -46438,6 +46461,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -46484,6 +46508,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -55662,6 +55696,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -55820,6 +55855,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -55955,6 +55991,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -56546,6 +56583,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -56698,6 +56736,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -57710,6 +57749,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -58773,6 +58813,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -59457,6 +59498,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -60029,6 +60071,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -60877,6 +60920,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+5109, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -61041,6 +61085,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -62159,6 +62204,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -63596,6 +63642,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -63762,6 +63809,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -64437,6 +64485,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -64813,6 +64862,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -68230,6 +68280,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -68395,6 +68446,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -69412,6 +69464,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -69509,6 +69562,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -69884,6 +69938,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -70266,6 +70321,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -70992,6 +71048,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -71141,6 +71198,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -72465,6 +72523,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -72478,6 +72537,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadPInt32(db+432) != 0 { @@ -72564,6 +72624,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -73177,6 +73238,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -73229,6 +73291,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -73268,6 +73331,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -74135,6 +74199,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -74261,6 +74326,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -74398,9 +74464,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -74507,6 +74575,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+6014, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -75470,6 +75539,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -75906,6 +75976,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -76011,6 +76082,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -76323,6 +76395,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -77091,6 +77164,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -79212,6 +79286,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -79243,6 +79318,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -79261,6 +79337,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5771, 0) @@ -79268,6 +79345,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -79277,6 +79355,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -79672,6 +79751,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -84589,6 +84669,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -88384,6 +88465,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -90360,11 +90442,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -90888,6 +90972,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -91972,6 +92057,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -92177,6 +92263,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -93132,6 +93219,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -93732,6 +93820,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10267, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93974,6 +94063,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94090,6 +94180,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10267, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -95227,6 +95318,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -95742,6 +95834,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11594, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -95906,6 +95999,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -96658,6 +96752,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.X__builtin___memset_chk(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero), libc.X__builtin_object_size(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -98408,6 +98503,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -98488,6 +98584,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -98542,6 +98639,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -100619,6 +100717,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -101177,6 +101276,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -101325,9 +101425,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13407, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -102498,6 +102600,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -103038,6 +103141,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103201,6 +103305,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103965,6 +104070,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -104150,6 +104256,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -104608,6 +104715,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -106611,6 +106719,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15557) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -107273,11 +107382,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -108581,10 +108692,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138714,6 +138847,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141180,6 +141314,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142055,6 +142190,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -147542,6 +147678,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148122,6 +148259,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22951, -int32(1)) @@ -149347,6 +149485,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -164450,8 +164589,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -164463,7 +164600,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -164523,7 +164660,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.X__builtin___memset_chk(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184), libc.X__builtin_object_size(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0)) _sqlite3RegisterBuiltinFunctions(tls) @@ -164539,7 +164676,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -164564,7 +164701,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -164579,10 +164716,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -164630,7 +164767,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171169,6 +171311,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -171821,6 +171964,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -171975,6 +172119,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172101,6 +172246,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -172218,6 +172364,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -172295,6 +172442,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -172353,6 +172501,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -172889,6 +173038,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -173725,6 +173875,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -173843,10 +173994,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25331, -int32(1)) @@ -174056,6 +174209,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174144,6 +174298,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -174233,6 +174388,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -174243,6 +174399,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+25331, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -174581,6 +174738,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -174948,9 +175106,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175060,6 +175220,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176150,6 +176311,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -179446,6 +179608,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180051,6 +180214,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -180599,6 +180763,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -181583,6 +181748,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182090,6 +182256,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -182193,8 +182360,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.X__builtin___memcpy_chk(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4), libc.X__builtin_object_size(tls, pBBox+4, 0)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -182821,6 +182988,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -182961,6 +183129,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183109,6 +183278,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -183391,6 +183561,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -185523,6 +185694,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -185962,6 +186134,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -190467,6 +190640,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -190557,6 +190731,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193027,6 +193202,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -193515,6 +193691,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -195644,6 +195821,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -203165,6 +203343,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -203297,6 +203476,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -203503,6 +203683,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -209006,6 +209187,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -209368,6 +209550,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -209399,6 +209582,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -210603,6 +210787,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -210820,6 +211005,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -216946,6 +217132,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -220691,6 +220878,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -220752,6 +220940,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -220777,6 +220966,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -221523,6 +221713,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) @@ -228490,3 +228681,4 @@ type Sqlite3_index_info = sqlite3_index_info type Sqlite3_module = sqlite3_module type Sqlite3_vtab = sqlite3_vtab type Sqlite3_vtab_cursor = sqlite3_vtab_cursor + diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go index 74721adaf4..ad9ad57c4d 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go @@ -1,4 +1,4 @@ -// Code generated for freebsd/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. +// Code generated for freebsd/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. //go:build freebsd && amd64 // +build freebsd,amd64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -13352,6 +13350,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -13420,6 +13419,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -18381,6 +18381,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20120,6 +20121,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -20995,6 +20997,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -21100,6 +21103,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -24967,6 +24971,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -25090,6 +25095,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26564,6 +26570,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -26705,6 +26712,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -27871,6 +27879,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags ctrlFlags |= int32(UNIXFILE_URI) } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -29663,6 +29672,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -29931,6 +29941,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -29959,6 +29970,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -30191,6 +30203,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -31430,7 +31443,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -31951,7 +31964,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -35448,6 +35461,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -35775,6 +35789,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -37700,6 +37715,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -38097,6 +38113,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -38262,6 +38279,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -39144,6 +39162,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -41544,6 +41563,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -41590,6 +41610,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -50768,6 +50798,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -50926,6 +50957,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -51061,6 +51093,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51652,6 +51685,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -51804,6 +51838,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -52816,6 +52851,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -53879,6 +53915,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -54563,6 +54600,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -55135,6 +55173,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55983,6 +56022,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4763, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -56147,6 +56187,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -57265,6 +57306,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -58702,6 +58744,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -58868,6 +58911,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -59543,6 +59587,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -59919,6 +59964,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -63336,6 +63382,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -63501,6 +63548,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -64518,6 +64566,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -64615,6 +64664,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -64990,6 +65040,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -65372,6 +65423,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -66098,6 +66150,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -66247,6 +66300,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -67571,6 +67625,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -67584,6 +67639,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadPInt32(db+432) != 0 { @@ -67670,6 +67726,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -68283,6 +68340,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -68335,6 +68393,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -68374,6 +68433,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -69241,6 +69301,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -69367,6 +69428,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -69504,9 +69566,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -69613,6 +69677,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5668, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -70576,6 +70641,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -71012,6 +71078,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -71117,6 +71184,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -71429,6 +71497,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -72197,6 +72266,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -74318,6 +74388,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -74349,6 +74420,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -74367,6 +74439,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5425, 0) @@ -74374,6 +74447,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -74383,6 +74457,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -74778,6 +74853,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -79695,6 +79771,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -83490,6 +83567,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -85466,11 +85544,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -85994,6 +86074,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -87078,6 +87159,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -87283,6 +87365,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -88238,6 +88321,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -88838,6 +88922,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9921, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89080,6 +89165,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89196,6 +89282,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9921, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -90333,6 +90420,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -90848,6 +90936,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11248, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -91012,6 +91101,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -91764,6 +91854,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -93514,6 +93605,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -93594,6 +93686,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -93648,6 +93741,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -95725,6 +95819,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -96283,6 +96378,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -96431,9 +96527,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13061, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -97604,6 +97702,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -98144,6 +98243,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -98307,6 +98407,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -99071,6 +99172,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -99256,6 +99358,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -99714,6 +99817,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -101717,6 +101821,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15211) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -102379,11 +102484,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -103687,10 +103794,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -133784,6 +133913,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -136250,6 +136380,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -137125,6 +137256,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -142612,6 +142744,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -143192,6 +143325,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22558, -int32(1)) @@ -144417,6 +144551,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -159520,8 +159655,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -159533,7 +159666,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -159593,7 +159726,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -159609,7 +159742,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -159634,7 +159767,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -159649,10 +159782,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -159700,7 +159833,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -166239,6 +166377,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -166891,6 +167030,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -167045,6 +167185,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -167171,6 +167312,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -167288,6 +167430,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -167365,6 +167508,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -167423,6 +167567,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -167959,6 +168104,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -168795,6 +168941,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -168913,10 +169060,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24938, -int32(1)) @@ -169126,6 +169275,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -169214,6 +169364,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -169303,6 +169454,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -169313,6 +169465,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24938, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -169651,6 +169804,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -170018,9 +170172,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -170130,6 +170286,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -171220,6 +171377,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -174517,6 +174675,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -175122,6 +175281,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -175670,6 +175830,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -176654,6 +176815,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -177161,6 +177323,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -177264,8 +177427,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -177892,6 +178055,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -178032,6 +178196,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -178180,6 +178345,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -178462,6 +178628,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -180594,6 +180761,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -181033,6 +181201,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -185538,6 +185707,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -185628,6 +185798,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -188098,6 +188269,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -188586,6 +188758,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -190715,6 +190888,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -198229,6 +198403,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -198361,6 +198536,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -198567,6 +198743,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -204070,6 +204247,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -204432,6 +204610,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -204463,6 +204642,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -205667,6 +205847,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -205884,6 +206065,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -212010,6 +212192,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -215755,6 +215938,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -215816,6 +216000,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -215841,6 +216026,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -216587,6 +216773,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go index a500656c1e..a45a4416ad 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go @@ -1,4 +1,4 @@ -// Code generated for freebsd/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. +// Code generated for freebsd/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. //go:build freebsd && arm64 // +build freebsd,arm64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -13363,6 +13361,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -13431,6 +13430,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x01) != 0 { @@ -18392,6 +18392,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20131,6 +20132,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21006,6 +21008,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -21111,6 +21114,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -24978,6 +24982,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -25101,6 +25106,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26575,6 +26581,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -26716,6 +26723,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -27882,6 +27890,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags ctrlFlags |= int32(UNIXFILE_URI) } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -29674,6 +29683,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -29942,6 +29952,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -29970,6 +29981,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -30202,6 +30214,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -31441,7 +31454,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -31962,7 +31975,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -35459,6 +35472,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -35786,6 +35800,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -37711,6 +37726,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -38108,6 +38124,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -38273,6 +38290,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -39155,6 +39173,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -41555,6 +41574,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -41601,6 +41621,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -50779,6 +50809,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -50937,6 +50968,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -51072,6 +51104,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51663,6 +51696,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -51815,6 +51849,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -52827,6 +52862,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -53890,6 +53926,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -54574,6 +54611,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -55146,6 +55184,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55994,6 +56033,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4763, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -56158,6 +56198,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -57276,6 +57317,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -58713,6 +58755,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -58879,6 +58922,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -59554,6 +59598,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -59930,6 +59975,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -63347,6 +63393,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -63512,6 +63559,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -64529,6 +64577,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -64626,6 +64675,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -65001,6 +65051,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -65383,6 +65434,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -66109,6 +66161,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -66258,6 +66311,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -67582,6 +67636,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -67595,6 +67650,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadPInt32(db+432) != 0 { @@ -67681,6 +67737,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -68294,6 +68351,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -68346,6 +68404,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -68385,6 +68444,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -69252,6 +69312,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -69378,6 +69439,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -69515,9 +69577,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -69624,6 +69688,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5668, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -70587,6 +70652,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -71023,6 +71089,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -71128,6 +71195,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -71440,6 +71508,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -72208,6 +72277,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -74329,6 +74399,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -74360,6 +74431,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -74378,6 +74450,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5425, 0) @@ -74385,6 +74458,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -74394,6 +74468,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -74789,6 +74864,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -79706,6 +79782,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -83501,6 +83578,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -85477,11 +85555,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -86005,6 +86085,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -87089,6 +87170,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -87294,6 +87376,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -88249,6 +88332,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -88849,6 +88933,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9921, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89091,6 +89176,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89207,6 +89293,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9921, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -90344,6 +90431,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -90859,6 +90947,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11248, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -91023,6 +91112,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -91775,6 +91865,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -93525,6 +93616,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -93605,6 +93697,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -93659,6 +93752,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -95736,6 +95830,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -96294,6 +96389,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -96442,9 +96538,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13061, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -97615,6 +97713,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -98155,6 +98254,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -98318,6 +98418,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -99082,6 +99183,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -99267,6 +99369,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -99725,6 +99828,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -101728,6 +101832,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15211) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -102390,11 +102495,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -103698,10 +103805,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -133795,6 +133924,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -136261,6 +136391,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -137136,6 +137267,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -142623,6 +142755,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -143203,6 +143336,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22558, -int32(1)) @@ -144428,6 +144562,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -159531,8 +159666,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -159544,7 +159677,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -159604,7 +159737,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -159620,7 +159753,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -159645,7 +159778,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -159660,10 +159793,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -159711,7 +159844,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -166250,6 +166388,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -166902,6 +167041,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -167056,6 +167196,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -167182,6 +167323,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -167299,6 +167441,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -167376,6 +167519,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -167434,6 +167578,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -167970,6 +168115,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -168806,6 +168952,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -168924,10 +169071,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24938, -int32(1)) @@ -169137,6 +169286,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -169225,6 +169375,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -169314,6 +169465,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -169324,6 +169476,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24938, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -169662,6 +169815,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -170029,9 +170183,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -170141,6 +170297,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -171231,6 +171388,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -174528,6 +174686,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -175133,6 +175292,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -175681,6 +175841,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -176665,6 +176826,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -177172,6 +177334,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -177275,8 +177438,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -177903,6 +178066,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -178043,6 +178207,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -178191,6 +178356,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -178473,6 +178639,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -180605,6 +180772,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -181044,6 +181212,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -185549,6 +185718,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -185639,6 +185809,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -188109,6 +188280,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -188597,6 +188769,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -190726,6 +190899,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -198240,6 +198414,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -198372,6 +198547,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -198578,6 +198754,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -204081,6 +204258,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -204443,6 +204621,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -204474,6 +204653,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -205678,6 +205858,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -205895,6 +206076,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -212021,6 +212203,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -215766,6 +215949,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -215827,6 +216011,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -215852,6 +216037,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -216598,6 +216784,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go index 1035949cec..4d7a2c3d2a 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go @@ -1,4 +1,4 @@ -// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && 386 // +build linux,386 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -14116,6 +14114,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -14184,6 +14183,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -19222,6 +19222,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20994,6 +20995,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21932,6 +21934,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -22039,6 +22042,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25904,6 +25908,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26035,6 +26040,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27539,6 +27545,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27685,6 +27692,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28901,6 +28909,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30725,6 +30734,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -30997,6 +31007,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if (*TBitvec)(unsafe.Pointer(p)).FnSet >= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)/libc.Uint32FromInt32(2) { @@ -31025,6 +31036,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31258,6 +31270,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32546,7 +32559,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+52) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33096,7 +33109,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+52, int32(1)) return SQLITE_OK } @@ -36679,6 +36692,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -37015,6 +37029,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -39018,6 +39033,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39441,6 +39457,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+28) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39618,6 +39635,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40566,6 +40584,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -43062,6 +43081,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43109,6 +43129,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -52791,6 +52821,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -52957,6 +52988,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53106,6 +53138,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53722,6 +53755,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -53880,6 +53914,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -54962,6 +54997,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56085,6 +56121,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell) @@ -56806,6 +56843,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57406,6 +57444,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58279,6 +58318,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4761, libc.VaList(bp+48, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58447,6 +58487,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59610,6 +59651,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61177,6 +61219,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61352,6 +61395,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -62048,6 +62092,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62436,6 +62481,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 20 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -65992,6 +66038,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66163,6 +66210,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67227,6 +67275,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67330,6 +67379,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67719,6 +67769,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68107,6 +68158,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -68844,6 +68896,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -68995,6 +69048,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70349,6 +70403,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*20 @@ -70362,6 +70417,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+304, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70455,6 +70511,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71103,6 +71160,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71155,6 +71213,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71194,6 +71253,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72106,6 +72166,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72245,6 +72306,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72387,9 +72449,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72502,6 +72566,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5666, libc.VaList(bp+672, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) @@ -73544,6 +73609,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -74036,6 +74102,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 96)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74150,6 +74217,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 128)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74477,6 +74545,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) @@ -75348,6 +75417,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 36)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77658,6 +77728,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77690,6 +77761,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77709,6 +77781,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5423, 0) @@ -77716,6 +77789,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77725,6 +77799,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78130,6 +78205,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+4) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83177,6 +83253,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 52)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87152,6 +87229,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89192,11 +89270,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -89746,6 +89826,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -90927,6 +91008,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91148,6 +91230,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92128,6 +92211,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -92747,6 +92831,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9919, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93009,6 +93094,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 44))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93127,6 +93213,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9919, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94275,6 +94362,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -94794,6 +94882,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11246, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -94962,6 +95051,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -95732,6 +95822,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint32(8)*uint32(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97527,6 +97618,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97608,6 +97700,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97664,6 +97757,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -99798,6 +99892,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100363,6 +100458,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100514,9 +100610,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -101729,6 +101827,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102287,6 +102386,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102455,6 +102555,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 44))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103253,6 +103354,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103444,6 +103546,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103919,6 +104022,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -105995,6 +106099,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15209) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106675,11 +106780,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -108001,10 +108108,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138943,6 +139072,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141509,6 +141639,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142408,6 +142539,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -148051,6 +148183,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148640,6 +148773,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22556, -int32(1)) @@ -149886,6 +150020,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165087,8 +165222,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165101,7 +165234,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165161,7 +165294,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint32(92)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165177,7 +165310,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165203,7 +165336,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165218,10 +165351,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165269,7 +165402,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171896,6 +172034,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172555,6 +172694,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -172710,6 +172850,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172837,6 +172978,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -172954,6 +173096,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -173035,6 +173178,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173093,6 +173237,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173637,6 +173782,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 25 @@ -174483,6 +174629,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174605,10 +174752,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24936, -int32(1)) @@ -174819,6 +174968,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174908,6 +175058,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(56)) @@ -174998,6 +175149,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -175008,6 +175160,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24936, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175347,6 +175500,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175717,9 +175871,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175829,6 +175985,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176924,6 +177081,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180251,6 +180409,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180861,6 +181020,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181409,6 +181569,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182399,6 +182560,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182907,6 +183069,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(40)+libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)*uint32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) @@ -183010,8 +183173,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183638,6 +183801,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183778,6 +183942,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183931,6 +184096,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 4)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184216,6 +184382,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186353,6 +186520,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186798,6 +186966,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191373,6 +191542,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191463,6 +191633,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193960,6 +194131,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194455,6 +194627,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196608,6 +196781,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf) @@ -204213,6 +204387,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204345,6 +204520,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204552,6 +204728,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210150,6 +210327,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -210526,6 +210704,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -210557,6 +210736,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211810,6 +211990,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -212035,6 +212216,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218303,6 +218485,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222088,6 +222271,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222149,6 +222333,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222174,6 +222359,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -222923,6 +223109,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go index 915119adf3..3f11b375b4 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated for linux/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && amd64 // +build linux,amd64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -13116,14 +13114,14 @@ func _sqlite3StatusValue(tls *libc.TLS, op int32) (r Tsqlite3_int64) { // ** mark is unchanged. N must be non-negative for StatusDown(). // */ func _sqlite3StatusUp(tls *libc.TLS, op int32, N int32) { - *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) += int64(N) + *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) += int64(int64(N)) if *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) > *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 80 + uintptr(op)*8)) { *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 80 + uintptr(op)*8)) = *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) } } func _sqlite3StatusDown(tls *libc.TLS, op int32, N int32) { - *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) -= int64(N) + *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + uintptr(op)*8)) -= int64(int64(N)) } // C documentation @@ -13135,7 +13133,7 @@ func _sqlite3StatusDown(tls *libc.TLS, op int32, N int32) { func _sqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { var newValue Tsqlite3StatValueType _ = newValue - newValue = int64(X) + newValue = int64(int64(X)) if newValue > *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 80 + uintptr(op)*8)) { *(*Tsqlite3StatValueType)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Stat)) + 80 + uintptr(op)*8)) = newValue } @@ -13595,7 +13593,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in val = val*int32(10) + int32(*(*int8)(unsafe.Pointer(zDate))) - int32('0') zDate++ } - if val < int32(min) || val > int32(max) || int32(nextC) != 0 && int32(nextC) != int32(*(*int8)(unsafe.Pointer(zDate))) { + if val < int32(int32(min)) || val > int32(int32(max)) || int32(int32(nextC)) != 0 && int32(int32(nextC)) != int32(*(*int8)(unsafe.Pointer(zDate))) { goto end_getDigits } *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = val @@ -13603,6 +13601,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -13671,6 +13670,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -13979,13 +13979,13 @@ func _computeYMD(tls *libc.TLS, p uintptr) { return } else { Z = int32(((*TDateTime)(unsafe.Pointer(p)).FiJD + libc.Int64FromInt32(43200000)) / libc.Int64FromInt32(86400000)) - A = int32((float64(Z) - libc.Float64FromFloat64(1.86721625e+06)) / libc.Float64FromFloat64(36524.25)) + A = int32((float64(float64(Z)) - libc.Float64FromFloat64(1.86721625e+06)) / libc.Float64FromFloat64(36524.25)) A = Z + int32(1) + A - A/int32(4) B = A + int32(1524) - C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) + C = int32((float64(float64(B)) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(libc.Float64FromFloat64(30.6001) * float64(float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -14126,10 +14126,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1211, -int32(1)) @@ -14391,10 +14391,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 _computeJD(tls, p) Z = ((*TDateTime)(unsafe.Pointer(p)).FiJD + int64(129600000)) / int64(86400000) % int64(7) - if Z > int64(n) { + if Z > int64(int64(n)) { Z -= int64(7) } - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += (int64(n) - Z) * int64(86400000) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += (int64(int64(n)) - Z) * int64(86400000) _clearYMD_HMS_TZ(tls, p) rc = 0 } @@ -14502,7 +14502,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** specified number of years, months, and days. MM is limited to ** the range 0-11 and DD is limited to 0-30. */ - if int32(z0) != int32('+') && int32(z0) != int32('-') { + if int32(int32(z0)) != int32('+') && int32(int32(z0)) != int32('-') { break } /* Must start with +/- */ if n == int32(5) { @@ -14523,7 +14523,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, } /* D range 0..30 */ _computeYMD_HMS(tls, p) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 - if int32(z0) == int32('-') { + if int32(int32(z0)) == int32('-') { *(*int32)(unsafe.Pointer(p + 8)) -= *(*int32)(unsafe.Pointer(bp + 56)) *(*int32)(unsafe.Pointer(p + 12)) -= *(*int32)(unsafe.Pointer(bp + 60)) *(*int32)(unsafe.Pointer(bp + 64)) = -*(*int32)(unsafe.Pointer(bp + 64)) @@ -14566,7 +14566,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD -= int64(43200000) day = (*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD / int64(86400000) (*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD -= day * int64(86400000) - if int32(z0) == int32('-') { + if int32(int32(z0)) == int32('-') { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD = -(*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD } _computeJD(tls, p) @@ -14950,11 +14950,11 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ j = i + uint64(1) cf = *(*int8)(unsafe.Pointer(zFmt + uintptr(i))) - switch int32(cf) { + switch int32(int32(cf)) { case int32('d'): /* Fall thru */ fallthrough case int32('e'): - if int32(cf) == int32('d') { + if int32(int32(cf)) == int32('d') { v3 = __ccgo_ts + 1339 } else { v3 = __ccgo_ts + 1344 @@ -14971,7 +14971,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { case int32('H'): fallthrough case int32('k'): - if int32(cf) == int32('H') { + if int32(int32(cf)) == int32('H') { v4 = __ccgo_ts + 1339 } else { v4 = __ccgo_ts + 1344 @@ -14987,7 +14987,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if h == 0 { h = int32(12) } - if int32(cf) == int32('I') { + if int32(int32(cf)) == int32('I') { v5 = __ccgo_ts + 1339 } else { v5 = __ccgo_ts + 1344 @@ -15002,7 +15002,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FD = int32(1) _computeJD(tls, bp+80) nDay = int32(((*(*TDateTime)(unsafe.Pointer(bp))).FiJD - (*(*TDateTime)(unsafe.Pointer(bp + 80))).FiJD + libc.Int64FromInt32(43200000)) / libc.Int64FromInt32(86400000)) - if int32(cf) == int32('W') { /* 0=Monday, 1=Tuesday, ... 6=Sunday */ + if int32(int32(cf)) == int32('W') { /* 0=Monday, 1=Tuesday, ... 6=Sunday */ wd = int32(((*(*TDateTime)(unsafe.Pointer(bp))).FiJD + libc.Int64FromInt32(43200000)) / libc.Int64FromInt32(86400000) % libc.Int64FromInt32(7)) Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1339, libc.VaList(bp+136, (nDay+int32(7)-wd)/int32(7))) } else { @@ -15018,14 +15018,14 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { - if int32(cf) == int32('p') { + if int32(int32(cf)) == int32('p') { v6 = __ccgo_ts + 1381 } else { v6 = __ccgo_ts + 1384 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { - if int32(cf) == int32('p') { + if int32(int32(cf)) == int32('p') { v7 = __ccgo_ts + 1387 } else { v7 = __ccgo_ts + 1390 @@ -15049,7 +15049,7 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('w'): c = int8(int32(int8(((*(*TDateTime)(unsafe.Pointer(bp))).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)%libc.Int64FromInt32(7))) + int32('0')) - if int32(c) == int32('0') && int32(cf) == int32('u') { + if int32(int32(c)) == int32('0') && int32(int32(cf)) == int32('u') { c = int8('7') } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) @@ -15212,7 +15212,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) (*(*TDateTime)(unsafe.Pointer(bp))).FvalidTZ = 0 _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1433, libc.VaList(bp+136, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1433, libc.VaList(bp+136, int32(int32(sign)), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15545,11 +15545,11 @@ func _sqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { func _sqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) (r int32) { if _sqlite3Config.FiPrngSeed != 0 { - libc.Xmemset(tls, zBufOut, 0, uint64(nByte)) + libc.Xmemset(tls, zBufOut, 0, uint64(uint64(nByte))) if nByte > libc.Int32FromInt64(4) { nByte = int32(4) } - libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&_sqlite3Config))+432, uint64(nByte)) + libc.Xmemcpy(tls, zBufOut, uintptr(unsafe.Pointer(&_sqlite3Config))+432, uint64(uint64(nByte))) return SQLITE_OK } else { return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxRandomness})))(tls, pVfs, nByte, zBufOut) @@ -15961,7 +15961,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { _ = p p = libc.Xmalloc(tls, uint64(nByte+int32(8))) if p != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(int64(nByte)) p += 8 } else { Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1548, libc.VaList(bp+8, nByte)) @@ -16023,7 +16023,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) p -= 8 p = libc.Xrealloc(tls, p, uint64(nByte+libc.Int32FromInt32(8))) if p != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(int64(nByte)) p += 8 } else { Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1586, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) @@ -16929,7 +16929,7 @@ func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { if n < 0 { n = 0 } - Xsqlite3_soft_heap_limit64(tls, int64(n)) + Xsqlite3_soft_heap_limit64(tls, int64(int64(n))) } // C documentation @@ -17076,12 +17076,12 @@ func _mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_MALLOC_SIZE), n) if _mem0.FalarmThreshold > 0 { nUsed = _sqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) - if nUsed >= _mem0.FalarmThreshold-int64(nFull) { + if nUsed >= _mem0.FalarmThreshold-int64(int64(nFull)) { libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_mem0))+24, libc.Int32FromInt32(1), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3MallocAlarm(tls, nFull) if _mem0.FhardLimit != 0 { nUsed = _sqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) - if nUsed >= _mem0.FhardLimit-int64(nFull) { + if nUsed >= _mem0.FhardLimit-int64(int64(nFull)) { *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) return } @@ -17133,10 +17133,10 @@ func _sqlite3Malloc(tls *libc.TLS, n Tu64) (r uintptr) { } else { if _sqlite3Config.FbMemstat != 0 { Xsqlite3_mutex_enter(tls, _mem0.Fmutex) - _mallocWithAlarm(tls, int32(n), bp) + _mallocWithAlarm(tls, int32(int32(n)), bp) Xsqlite3_mutex_leave(tls, _mem0.Fmutex) } else { - *(*uintptr)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxMalloc})))(tls, int32(n)) + *(*uintptr)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxMalloc})))(tls, int32(int32(n))) } } /* IMP: R-11148-40995 */ @@ -17159,7 +17159,7 @@ func Xsqlite3_malloc(tls *libc.TLS, n int32) (r uintptr) { if n <= 0 { v1 = uintptr(0) } else { - v1 = _sqlite3Malloc(tls, uint64(n)) + v1 = _sqlite3Malloc(tls, uint64(uint64(n))) } return v1 } @@ -17203,11 +17203,11 @@ func _lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { func _sqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if db != 0 { - if uint64(p) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd) { - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { + if uint64(uint64(p)) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { return int32(LOOKASIDE_SMALL) } - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { return int32((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } } @@ -17267,14 +17267,14 @@ func _sqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { var pBuf, pBuf1 uintptr _, _ = pBuf, pBuf1 if db != 0 { - if uint64(p) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { + if uint64(uint64(p)) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { pBuf = p (*TLookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf return } - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { pBuf1 = p (*TLookasideSlot)(unsafe.Pointer(pBuf1)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf1 @@ -17292,14 +17292,14 @@ func _sqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { func _sqlite3DbNNFreeNN(tls *libc.TLS, db uintptr, p uintptr) { var pBuf, pBuf1 uintptr _, _ = pBuf, pBuf1 - if uint64(p) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { + if uint64(uint64(p)) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { pBuf = p (*TLookasideSlot)(unsafe.Pointer(pBuf)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = pBuf return } - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { pBuf1 = p (*TLookasideSlot)(unsafe.Pointer(pBuf1)).FpNext = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = pBuf1 @@ -17345,28 +17345,28 @@ func _sqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes Tu64) (r uintptr) { /* IMPLEMENTATION-OF: R-46199-30249 SQLite guarantees that the second ** argument to xRealloc is always a value returned by a prior call to ** xRoundup. */ - nNew = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(nBytes)) + nNew = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(int32(nBytes))) if nOld == nNew { pNew = pOld } else { if _sqlite3Config.FbMemstat != 0 { Xsqlite3_mutex_enter(tls, _mem0.Fmutex) - _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_MALLOC_SIZE), int32(nBytes)) + _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_MALLOC_SIZE), int32(int32(nBytes))) nDiff = nNew - nOld if v2 = nDiff > 0; v2 { v1 = _sqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) nUsed = v1 } - if v2 && v1 >= _mem0.FalarmThreshold-int64(nDiff) { + if v2 && v1 >= _mem0.FalarmThreshold-int64(int64(nDiff)) { _sqlite3MallocAlarm(tls, nDiff) - if _mem0.FhardLimit > 0 && nUsed >= _mem0.FhardLimit-int64(nDiff) { + if _mem0.FhardLimit > 0 && nUsed >= _mem0.FhardLimit-int64(int64(nDiff)) { Xsqlite3_mutex_leave(tls, _mem0.Fmutex) return uintptr(0) } } pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRealloc})))(tls, pOld, nNew) if pNew == uintptr(0) && _mem0.FalarmThreshold > 0 { - _sqlite3MallocAlarm(tls, int32(nBytes)) + _sqlite3MallocAlarm(tls, int32(int32(nBytes))) pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRealloc})))(tls, pOld, nNew) } if pNew != 0 { @@ -17395,7 +17395,7 @@ func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) (r uintptr) { if n < 0 { n = 0 } /* IMP: R-26507-47431 */ - return _sqlite3Realloc(tls, pOld, uint64(n)) + return _sqlite3Realloc(tls, pOld, uint64(uint64(n))) } func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Tsqlite3_uint64) (r uintptr) { @@ -17415,7 +17415,7 @@ func _sqlite3MallocZero(tls *libc.TLS, n Tu64) (r uintptr) { _ = p p = _sqlite3Malloc(tls, n) if p != 0 { - libc.Xmemset(tls, p, 0, n) + libc.Xmemset(tls, p, 0, uint64(uint64(n))) } return p } @@ -17431,7 +17431,7 @@ func _sqlite3DbMallocZero(tls *libc.TLS, db uintptr, n Tu64) (r uintptr) { _ = p p = _sqlite3DbMallocRaw(tls, db, n) if p != 0 { - libc.Xmemset(tls, p, 0, n) + libc.Xmemset(tls, p, 0, uint64(uint64(n))) } return p } @@ -17545,13 +17545,13 @@ func _sqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n Tu64) (r uintptr) if p == uintptr(0) { return _sqlite3DbMallocRawNN(tls, db, n) } - if uint64(p) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { + if uint64(uint64(p)) < uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { if n <= uint64(LOOKASIDE_SMALL) { return p } } else { - if uint64(p) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { + if uint64(uint64(p)) >= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { if n <= uint64((*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) { return p } @@ -17615,7 +17615,7 @@ func _sqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) (r uintptr) { return uintptr(0) } n = libc.Xstrlen(tls, z) + uint64(1) - zNew = _sqlite3DbMallocRaw(tls, db, n) + zNew = _sqlite3DbMallocRaw(tls, db, uint64(uint64(n))) if zNew != 0 { libc.Xmemcpy(tls, zNew, z, n) } @@ -17632,7 +17632,7 @@ func _sqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n Tu64) (r uintptr) } zNew = v1 if zNew != 0 { - libc.Xmemcpy(tls, zNew, z, n) + libc.Xmemcpy(tls, zNew, z, uint64(uint64(n))) *(*int8)(unsafe.Pointer(zNew + uintptr(n))) = 0 } return zNew @@ -17651,11 +17651,11 @@ func _sqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))])&int32(0x01) != 0 { zStart++ } - n = int32(int64(zEnd) - int64(zStart)) + n = int32(int64(int64(zEnd)) - int64(int64(zStart))) for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart + uintptr(n-int32(1)))))])&int32(0x01) != 0 { n-- } - return _sqlite3DbStrNDup(tls, db, zStart, uint64(n)) + return _sqlite3DbStrNDup(tls, db, zStart, uint64(uint64(n))) } // C documentation @@ -17977,8 +17977,8 @@ func _sqlite3StrAccumSetError(tls *libc.TLS, p uintptr, eError Tu8) { if (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 { Xsqlite3_str_reset(tls, p) } - if int32(eError) == int32(SQLITE_TOOBIG) { - _sqlite3ErrorToParser(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, int32(eError)) + if int32(int32(eError)) == int32(SQLITE_TOOBIG) { + _sqlite3ErrorToParser(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, int32(int32(eError))) } } @@ -18047,7 +18047,7 @@ func _printfTempBuf(tls *libc.TLS, pAccum uintptr, n Tsqlite3_int64) (r uintptr) _sqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } - z = _sqlite3DbMallocRaw(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) + z = _sqlite3DbMallocRaw(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(uint64(n))) if z == uintptr(0) { _sqlite3StrAccumSetError(tls, pAccum, uint8(SQLITE_NOMEM)) } @@ -18087,7 +18087,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ xtype = uint8(etINVALID) /* Size of the rendering buffer */ zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -18109,7 +18109,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li for cond := true; cond; cond = *(*int8)(unsafe.Pointer(fmt)) != 0 && int32(*(*int8)(unsafe.Pointer(fmt))) != int32('%') { fmt++ } - Xsqlite3_str_append(tls, pAccum, bufpt, int32(int64(fmt)-int64(bufpt))) + Xsqlite3_str_append(tls, pAccum, bufpt, int32(int64(int64(fmt))-int64(int64(bufpt)))) if int32(*(*int8)(unsafe.Pointer(fmt))) == 0 { break } @@ -18194,7 +18194,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if !(v16 >= int32('0') && c <= int32('9')) { break } - wx = wx*uint32(10) + uint32(c) - uint32('0') + wx = wx*uint32(10) + uint32(uint32(c)) - uint32('0') } width = int32(wx & uint32(0x7fffffff)) if c != int32('.') && c != int32('l') { @@ -18249,7 +18249,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { px = uint32(0) for c >= int32('0') && c <= int32('9') { - px = px*uint32(10) + uint32(c) - uint32('0') + px = px*uint32(10) + uint32(uint32(c)) - uint32('0') fmt++ v24 = fmt c = int32(*(*int8)(unsafe.Pointer(v24))) @@ -18311,7 +18311,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** xtype The class of the conversion. ** infop Pointer to the appropriate info struct. */ - switch int32(xtype) { + switch int32(int32(xtype)) { case int32(etPOINTER): goto _26 case etRADIX: @@ -18365,10 +18365,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v = _getIntArg(tls, pArgList) } else { if flag_long != 0 { - if int32(flag_long) == int32(2) { + if int32(int32(flag_long)) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18379,18 +18379,18 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li longvalue++ prefix = int8('-') } else { - longvalue = uint64(v) - prefix = int8(flag_prefix) + longvalue = uint64(uint64(v)) + prefix = int8(int8(flag_prefix)) } } else { if bArgList != 0 { longvalue = uint64(_getIntArg(tls, pArgList)) } else { if flag_long != 0 { - if int32(flag_long) == int32(2) { + if int32(int32(flag_long)) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18401,27 +18401,27 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if longvalue == uint64(0) { flag_alternateform = uint8(0) } - if flag_zeropad != 0 && precision < width-libc.BoolInt32(int32(prefix) != 0) { - precision = width - libc.BoolInt32(int32(prefix) != 0) + if flag_zeropad != 0 && precision < width-libc.BoolInt32(int32(int32(prefix)) != 0) { + precision = width - libc.BoolInt32(int32(int32(prefix)) != 0) } if precision < libc.Int32FromInt32(SQLITE_PRINT_BUF_SIZE)-libc.Int32FromInt32(10)-libc.Int32FromInt32(SQLITE_PRINT_BUF_SIZE)/libc.Int32FromInt32(3) { nOut = int32(SQLITE_PRINT_BUF_SIZE) zOut = bp } else { - n = uint64(precision) + uint64(10) + n = uint64(uint64(precision)) + uint64(10) if cThousand != 0 { n += uint64(precision / int32(3)) } - v45 = _printfTempBuf(tls, pAccum, int64(n)) + v45 = _printfTempBuf(tls, pAccum, int64(int64(n))) zExtra = v45 zOut = v45 if zOut == uintptr(0) { return } - nOut = int32(n) + nOut = int32(int32(n)) } bufpt = zOut + uintptr(nOut-int32(1)) - if int32(xtype) == int32(etORDINAL) { + if int32(int32(xtype)) == int32(etORDINAL) { x = int32(longvalue % libc.Uint64FromInt32(10)) if x >= int32(4) || longvalue/uint64(10)%uint64(10) == uint64(1) { x = 0 @@ -18438,10 +18438,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li for cond := true; cond; cond = longvalue > uint64(0) { /* Convert to ascii */ bufpt-- v48 = bufpt - *(*int8)(unsafe.Pointer(v48)) = *(*int8)(unsafe.Pointer(cset + uintptr(longvalue%uint64(base)))) - longvalue = longvalue / uint64(base) + *(*int8)(unsafe.Pointer(v48)) = *(*int8)(unsafe.Pointer(cset + uintptr(longvalue%uint64(uint64(base))))) + longvalue = longvalue / uint64(uint64(base)) } - length = int32(t__predefined_ptrdiff_t(zOut+uintptr(nOut-int32(1))) - int64(bufpt)) + length = int32(t__predefined_ptrdiff_t(zOut+uintptr(nOut-int32(1))) - int64(int64(bufpt))) for precision > length { bufpt-- v49 = bufpt @@ -18462,7 +18462,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if ix == 0 { idx++ v51 = idx - *(*int8)(unsafe.Pointer(bufpt + uintptr(v51))) = int8(cThousand) + *(*int8)(unsafe.Pointer(bufpt + uintptr(v51))) = int8(int8(cThousand)) nn-- ix = int32(3) } @@ -18494,7 +18494,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li pre++ } } - length = int32(t__predefined_ptrdiff_t(zOut+uintptr(nOut-int32(1))) - int64(bufpt)) + length = int32(t__predefined_ptrdiff_t(zOut+uintptr(nOut-int32(1))) - int64(int64(bufpt))) goto _44 _32: ; @@ -18513,10 +18513,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if precision > int32(SQLITE_FP_PRECISION_LIMIT) { precision = int32(SQLITE_FP_PRECISION_LIMIT) } - if int32(xtype) == int32(etFLOAT) { + if int32(int32(xtype)) == int32(etFLOAT) { iRound = -precision } else { - if int32(xtype) == int32(etGENERIC) { + if int32(int32(xtype)) == int32(etGENERIC) { if precision == 0 { precision = int32(1) } @@ -18553,7 +18553,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li /* no-op */ } else { if flag_prefix != 0 { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(flag_prefix) + (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int8(flag_prefix)) } else { bufpt++ } @@ -18566,17 +18566,17 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { prefix = int8('-') } else { - prefix = int8(flag_prefix) + prefix = int8(int8(flag_prefix)) } exp = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) - if int32(xtype) == int32(etGENERIC) && precision > 0 { + if int32(int32(xtype)) == int32(etGENERIC) && precision > 0 { precision-- } /* ** If the field type is etGENERIC, then convert to either etEXP ** or etFLOAT, as appropriate. */ - if int32(xtype) == int32(etGENERIC) { + if int32(int32(xtype)) == int32(etGENERIC) { flag_rtz = libc.BoolUint8(!(flag_alternateform != 0)) if exp < -int32(4) || exp > precision { xtype = uint8(etEXP) @@ -18587,7 +18587,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { flag_rtz = flag_altform2 } - if int32(xtype) == int32(etEXP) { + if int32(int32(xtype)) == int32(etEXP) { e2 = 0 } else { e2 = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) @@ -18599,7 +18599,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { v58 = 0 } - szBufNeeded = int64(v58) + int64(precision) + int64(width) + int64(15) + szBufNeeded = int64(v58) + int64(int64(precision)) + int64(int64(width)) + int64(15) if cThousand != 0 && e2 > 0 { szBufNeeded += int64((e2 + int32(2)) / int32(3)) } @@ -18617,7 +18617,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { v60 = 0 } - flag_dp = uint8(v60 | int32(flag_alternateform) | int32(flag_altform2)) + flag_dp = uint8(v60 | int32(int32(flag_alternateform)) | int32(int32(flag_altform2))) /* The sign in front of the number */ if prefix != 0 { v61 = bufpt @@ -18716,7 +18716,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } /* Add the "eNNN" suffix */ - if int32(xtype) == int32(etEXP) { + if int32(int32(xtype)) == int32(etEXP) { exp = (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP - int32(1) v78 = bufpt bufpt++ @@ -18748,7 +18748,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li /* The converted number is in buf[] and zero terminated. Output it. ** Note that the number is in the usual order, not reversed as with ** integer conversions. */ - length = int32(int64(bufpt) - int64(zOut)) + length = int32(int64(int64(bufpt)) - int64(int64(zOut))) bufpt = zOut /* Special case: Add leading zeros if the flag_zeropad flag is ** set and we are not left justified */ @@ -18765,7 +18765,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; i-- } - i = libc.BoolInt32(int32(prefix) != 0) + i = libc.BoolInt32(int32(int32(prefix)) != 0) for { v85 = nPad nPad-- @@ -18856,14 +18856,14 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if nPrior > int64(precision-int32(1)) { nPrior = int64(precision - int32(1)) } - nCopyBytes = int64(length) * nPrior + nCopyBytes = int64(int64(length)) * nPrior if nCopyBytes+int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar) >= int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc) { _sqlite3StrAccumEnlarge(tls, pAccum, nCopyBytes) } if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 { break } - Xsqlite3_str_append(tls, pAccum, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FzText+uintptr(int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar)-nCopyBytes), int32(nCopyBytes)) + Xsqlite3_str_append(tls, pAccum, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FzText+uintptr(int64((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar)-nCopyBytes), int32(int32(nCopyBytes))) precision = int32(int64(precision) - nPrior) nPrior *= int64(2) } @@ -18884,7 +18884,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if bufpt == uintptr(0) { bufpt = __ccgo_ts + 1652 } else { - if int32(xtype) == int32(etDYNSTRING) { + if int32(int32(xtype)) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { /* Special optimization for sqlite3_mprintf("%z..."): ** Extend an existing memory allocation rather than creating @@ -18919,7 +18919,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } } - length = int32(int64(z) - int64(bufpt)) + length = int32(int64(int64(z)) - int64(bufpt)) } else { length = 0 for { @@ -18935,6 +18935,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -18955,7 +18956,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if int32(xtype) == int32(etSQLESCAPE3) { + if int32(int32(xtype)) == int32(etSQLESCAPE3) { v97 = int32('"') } else { v97 = int32('\'') @@ -18968,7 +18969,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } isnull = libc.BoolInt32(escarg == uintptr(0)) if isnull != 0 { - if int32(xtype) == int32(etSQLESCAPE2) { + if int32(int32(xtype)) == int32(etSQLESCAPE2) { v98 = __ccgo_ts + 1653 } else { v98 = __ccgo_ts + 1658 @@ -18980,7 +18981,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** Because of the extra quoting characters inserted, the number ** of output characters may be larger than the precision. */ - k = int64(precision) + k = int64(int64(precision)) v100 = libc.Int64FromInt32(0) n1 = v100 i1 = v100 @@ -18992,10 +18993,10 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if !(v102 && int32(v101) != 0) { break } - if int32(ch1) == int32(q) { + if int32(int32(ch1)) == int32(int32(q)) { n1++ } - if flag_altform2 != 0 && int32(ch1)&int32(0xc0) == int32(0xc0) { + if flag_altform2 != 0 && int32(int32(ch1))&int32(0xc0) == int32(0xc0) { for int32(*(*int8)(unsafe.Pointer(escarg + uintptr(i1+int64(1)))))&int32(0xc0) == int32(0x80) { i1++ } @@ -19006,7 +19007,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && int32(xtype) == int32(etSQLESCAPE2)) + needQuote = libc.BoolInt32(!(isnull != 0) && int32(int32(xtype)) == int32(etSQLESCAPE2)) n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -19035,7 +19036,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) ch1 = v107 *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { + if int32(int32(ch1)) == int32(int32(q)) { v108 = j1 j1++ *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 @@ -19051,7 +19052,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 - length = int32(j1) + length = int32(int32(j1)) goto adjust_width_for_utf8 _41: ; @@ -19176,7 +19177,7 @@ func _sqlite3RecordErrorByteOffset(tls *libc.TLS, db uintptr, z uintptr) { } zEnd = zText + uintptr(libc.Xstrlen(tls, zText)) if uint64(z) >= uint64(zText) && uint64(z) < uint64(zEnd) { - (*Tsqlite3)(unsafe.Pointer(db)).FerrByteOffset = int32(int64(z) - int64(zText)) + (*Tsqlite3)(unsafe.Pointer(db)).FerrByteOffset = int32(int64(int64(z)) - int64(int64(zText))) } } @@ -19234,7 +19235,7 @@ func _sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N Ti64) (r int32) { _sqlite3StrAccumSetError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { - (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(int32(szNew)) + (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(int32(int32(szNew))) } if (*TStrAccum)(unsafe.Pointer(p)).Fdb != 0 { zNew = _sqlite3DbRealloc(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, zOld, uint64((*TStrAccum)(unsafe.Pointer(p)).FnAlloc)) @@ -19255,7 +19256,7 @@ func _sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N Ti64) (r int32) { return 0 } } - return int32(N) + return int32(int32(N)) } // C documentation @@ -19269,8 +19270,8 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { var v4 Tu32 var v5 uintptr _, _, _, _, _ = v1, v2, v3, v4, v5 - if v2 = int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar)+int64(N) >= int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc); v2 { - v1 = _sqlite3StrAccumEnlarge(tls, p, int64(N)) + if v2 = int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar)+int64(int64(N)) >= int64((*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc); v2 { + v1 = _sqlite3StrAccumEnlarge(tls, p, int64(int64(N))) N = v1 } if v2 && v1 <= 0 { @@ -19300,10 +19301,10 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { // ** sqlite3_str_append() routine can use fast calling semantics. // */ func _enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { - N = _sqlite3StrAccumEnlarge(tls, p, int64(N)) + N = _sqlite3StrAccumEnlarge(tls, p, int64(int64(N))) if N > 0 { - libc.Xmemcpy(tls, (*TStrAccum)(unsafe.Pointer(p)).FzText+uintptr((*TStrAccum)(unsafe.Pointer(p)).FnChar), z, uint64(N)) - *(*Tu32)(unsafe.Pointer(p + 24)) += uint32(N) + libc.Xmemcpy(tls, (*TStrAccum)(unsafe.Pointer(p)).FzText+uintptr((*TStrAccum)(unsafe.Pointer(p)).FnChar), z, uint64(uint64(N))) + *(*Tu32)(unsafe.Pointer(p + 24)) += uint32(uint32(N)) } } @@ -19314,12 +19315,12 @@ func _enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { // ** size of the memory allocation for StrAccum if necessary. // */ func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { - if (*Tsqlite3_str)(unsafe.Pointer(p)).FnChar+uint32(N) >= (*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc { + if (*Tsqlite3_str)(unsafe.Pointer(p)).FnChar+uint32(uint32(N)) >= (*Tsqlite3_str)(unsafe.Pointer(p)).FnAlloc { _enlargeAndAppend(tls, p, z, N) } else { if N != 0 { - *(*Tu32)(unsafe.Pointer(p + 24)) += uint32(N) - libc.Xmemcpy(tls, (*Tsqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar-uint32(N)), z, uint64(N)) + *(*Tu32)(unsafe.Pointer(p + 24)) += uint32(uint32(N)) + libc.Xmemcpy(tls, (*Tsqlite3_str)(unsafe.Pointer(p)).FzText+uintptr((*Tsqlite3_str)(unsafe.Pointer(p)).FnChar-uint32(uint32(N))), z, uint64(uint64(N))) } } } @@ -19489,8 +19490,8 @@ func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { func _sqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { (*TStrAccum)(unsafe.Pointer(p)).FzText = zBase (*TStrAccum)(unsafe.Pointer(p)).Fdb = db - (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(n) - (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc = uint32(mx) + (*TStrAccum)(unsafe.Pointer(p)).FnAlloc = uint32(uint32(n)) + (*TStrAccum)(unsafe.Pointer(p)).FmxAlloc = uint32(uint32(mx)) (*TStrAccum)(unsafe.Pointer(p)).FnChar = uint32(0) (*TStrAccum)(unsafe.Pointer(p)).FaccError = uint8(0) (*TStrAccum)(unsafe.Pointer(p)).FprintfFlags = uint8(0) @@ -20052,7 +20053,7 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { } for int32(1) != 0 { if N <= int32(_sqlite3Prng.Fn) { - libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&_sqlite3Prng))+64+uintptr(int32(_sqlite3Prng.Fn)-N), uint64(N)) + libc.Xmemcpy(tls, zBuf, uintptr(unsafe.Pointer(&_sqlite3Prng))+64+uintptr(int32(_sqlite3Prng.Fn)-N), uint64(uint64(N))) p1 = uintptr(unsafe.Pointer(&_sqlite3Prng)) + 128 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) - N) break @@ -20428,7 +20429,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in ** all that is required is to swap the byte order. This case is handled ** differently from the others. */ - if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) && int32(desiredEnc) != int32(SQLITE_UTF8) { + if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) && int32(int32(desiredEnc)) != int32(SQLITE_UTF8) { rc = _sqlite3VdbeMemMakeWriteable(tls, pMem) if rc != SQLITE_OK { return int32(SQLITE_NOMEM) @@ -20447,7 +20448,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in goto translate_out } /* Set len to the maximum number of bytes required in the output buffer. */ - if int32(desiredEnc) == int32(SQLITE_UTF8) { + if int32(int32(desiredEnc)) == int32(SQLITE_UTF8) { /* When converting from UTF-16, the maximum growth results from ** translating a 2-byte character to a 4-byte UTF-8 character. ** A single byte is required for the output string @@ -20471,13 +20472,13 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in */ zIn = (*TMem)(unsafe.Pointer(pMem)).Fz zTerm = zIn + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn) - zOut = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(len1)) + zOut = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(uint64(len1))) if !(zOut != 0) { return int32(SQLITE_NOMEM) } z = zOut if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) == int32(SQLITE_UTF8) { - if int32(desiredEnc) == int32(SQLITE_UTF16LE) { + if int32(int32(desiredEnc)) == int32(SQLITE_UTF16LE) { /* UTF-8 -> UTF-16 Little-endian */ for zIn < zTerm { v2 = zIn @@ -20556,7 +20557,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in } } } - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int64(z) - int64(zOut)) + (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int64(int64(z)) - int64(int64(zOut))) v18 = z z++ *(*uint8)(unsafe.Pointer(v18)) = uint8(0) @@ -20682,16 +20683,17 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in } } } - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int64(z) - int64(zOut)) + (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int64(int64(z)) - int64(int64(zOut))) } *(*uint8)(unsafe.Pointer(z)) = uint8(0) c = uint32(libc.Int32FromInt32(MEM_Str) | libc.Int32FromInt32(MEM_Term) | int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_AffMask)|libc.Int32FromInt32(MEM_Subtype))) _sqlite3VdbeMemRelease(tls, pMem) - (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(c) + (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(uint16(c)) (*TMem)(unsafe.Pointer(pMem)).Fenc = desiredEnc (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -20719,10 +20721,10 @@ func _sqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) (r int32) { if (*TMem)(unsafe.Pointer(pMem)).Fn > int32(1) { b1 = *(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz)) b2 = *(*Tu8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + libc.UintptrFromInt32(1))) - if int32(b1) == int32(0xFE) && int32(b2) == int32(0xFF) { + if int32(int32(b1)) == int32(0xFE) && int32(int32(b2)) == int32(0xFF) { bom = uint8(SQLITE_UTF16BE) } - if int32(b1) == int32(0xFF) && int32(b2) == int32(0xFE) { + if int32(int32(b1)) == int32(0xFF) && int32(int32(b2)) == int32(0xFE) { bom = uint8(SQLITE_UTF16LE) } } @@ -20793,7 +20795,7 @@ func _sqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc Tu8 var _ /* m at bp+0 */ TMem libc.Xmemset(tls, bp, 0, uint64(56)) (*(*TMem)(unsafe.Pointer(bp))).Fdb = db - _sqlite3VdbeMemSetStr(tls, bp, z, int64(nByte), enc, libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, bp, z, int64(int64(nByte)), enc, libc.UintptrFromInt32(0)) _sqlite3VdbeChangeEncoding(tls, bp, int32(SQLITE_UTF8)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3VdbeMemRelease(tls, bp) @@ -20826,7 +20828,7 @@ func _sqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) (r int32) { } n++ } - return int32(int64(z)-int64(zIn)) - libc.BoolInt32(true) + return int32(int64(int64(z))-int64(zIn)) - libc.BoolInt32(true) } type Tfloat_t = float32 @@ -21168,14 +21170,14 @@ func _sqlite3Dequote(tls *libc.TLS, z uintptr) { if !(int32(_sqlite3CtypeMap[uint8(quote)])&libc.Int32FromInt32(0x80) != 0) { return } - if int32(quote) == int32('[') { + if int32(int32(quote)) == int32('[') { quote = int8(']') } i = int32(1) j = libc.Int32FromInt32(0) for { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(quote) { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32(quote) { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(int32(quote)) { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(i+int32(1))))) == int32(int32(quote)) { v2 = j j++ *(*int8)(unsafe.Pointer(z + uintptr(v2))) = quote @@ -21446,25 +21448,25 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T var _ /* rr at bp+0 */ [2]float64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, e, eType, eValid, esign, i, incr, nDigit, r, s, s2, sign, zEnd, v2, v3, v4 /* sign * significand * (10 ^ (esign * exponent)) */ - sign = int32(1) /* sign of significand */ - s = uint64(0) /* significand */ - d = 0 /* adjust exponent for shifting decimal point */ - esign = int32(1) /* sign of exponent */ - e = 0 /* exponent */ - eValid = int32(1) /* True exponent is either not used or is well-formed */ - nDigit = 0 /* Number of digits processed */ - eType = int32(1) /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ + sign = int32(1) /* sign of significand */ + s = uint64(0) /* significand */ + d = 0 /* adjust exponent for shifting decimal point */ + esign = int32(1) /* sign of exponent */ + e = 0 /* exponent */ + eValid = int32(1) /* True exponent is either not used or is well-formed */ + nDigit = 0 /* Number of digits processed */ + eType = int32(1) /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ *(*float64)(unsafe.Pointer(pResult)) = float64(0) /* Default return value, in case of an error */ if length == 0 { return 0 } - if int32(enc) == int32(SQLITE_UTF8) { + if int32(int32(enc)) == int32(SQLITE_UTF8) { incr = int32(1) zEnd = z + uintptr(length) } else { incr = int32(2) length &= ^libc.Int32FromInt32(1) - i = int32(3) - int32(enc) + i = int32(3) - int32(int32(enc)) for { if !(i < length && int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) { break @@ -21478,7 +21480,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T eType = -int32(100) } zEnd = z + uintptr(i^int32(1)) - z += uintptr(int32(enc) & libc.Int32FromInt32(1)) + z += uintptr(int32(int32(enc)) & libc.Int32FromInt32(1)) } /* skip leading spaces */ for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { @@ -21567,6 +21569,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -21591,44 +21594,44 @@ do_atof_calc: e++ } if e == 0 { - *(*float64)(unsafe.Pointer(pResult)) = float64(s) + *(*float64)(unsafe.Pointer(pResult)) = float64(float64(s)) } else { if _sqlite3Config.FbUseLongDouble != 0 { - r = float64(s) + r = float64(float64(s)) if e > 0 { for e >= int32(100) { e -= int32(100) - r = r * libc.Float64FromFloat64(1e+100) + r = float64(float64(r) * libc.Float64FromFloat64(1e+100)) } for e >= int32(10) { e -= int32(10) - r = r * libc.Float64FromFloat64(1e+10) + r = float64(float64(r) * libc.Float64FromFloat64(1e+10)) } for e >= int32(1) { e -= int32(1) - r = r * libc.Float64FromFloat64(10) + r = float64(float64(r) * libc.Float64FromFloat64(10)) } } else { for e <= -int32(100) { e += int32(100) - r = r * libc.Float64FromFloat64(1e-100) + r = float64(float64(r) * libc.Float64FromFloat64(1e-100)) } for e <= -int32(10) { e += int32(10) - r = r * libc.Float64FromFloat64(1e-10) + r = float64(float64(r) * libc.Float64FromFloat64(1e-10)) } for e <= -int32(1) { e += int32(1) - r = r * libc.Float64FromFloat64(0.1) + r = float64(float64(r) * libc.Float64FromFloat64(0.1)) } } - if r > +libc.Float64FromFloat64(1.7976931348623157081452742373e+308) { + if float64(float64(r)) > +libc.Float64FromFloat64(1.7976931348623157081452742373e+308) { *(*float64)(unsafe.Pointer(pResult)) = float64(+libc.X__builtin_inff(tls)) } else { *(*float64)(unsafe.Pointer(pResult)) = r } } else { - (*(*[2]float64)(unsafe.Pointer(bp)))[0] = float64(s) + (*(*[2]float64)(unsafe.Pointer(bp)))[0] = float64(float64(s)) s2 = uint64((*(*[2]float64)(unsafe.Pointer(bp)))[0]) if s >= s2 { v4 = float64(s - s2) @@ -21672,6 +21675,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -21713,7 +21717,7 @@ func _sqlite3Int64ToText(tls *libc.TLS, v Ti64, zOut uintptr) (r int32) { } x = v1 } else { - x = uint64(v) + x = uint64(uint64(v)) } i = int32(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(2)) (*(*[22]int8)(unsafe.Pointer(bp)))[libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)] = 0 @@ -21730,8 +21734,8 @@ func _sqlite3Int64ToText(tls *libc.TLS, v Ti64, zOut uintptr) (r int32) { v2 = i (*(*[22]int8)(unsafe.Pointer(bp)))[v2] = int8('-') } - libc.Xmemcpy(tls, zOut, bp+uintptr(i), uint64(22)-uint64(i)) - return int32(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1) - uint64(i)) + libc.Xmemcpy(tls, zOut, bp+uintptr(i), uint64(22)-uint64(uint64(i))) + return int32(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1) - uint64(uint64(i))) } // C documentation @@ -21804,12 +21808,12 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc c = 0 nonNum = 0 zEnd = zNum + uintptr(length) - if int32(enc) == int32(SQLITE_UTF8) { + if int32(int32(enc)) == int32(SQLITE_UTF8) { incr = int32(1) } else { incr = int32(2) length &= ^libc.Int32FromInt32(1) - i = int32(3) - int32(enc) + i = int32(3) - int32(int32(enc)) for { if !(i < length && int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0) { break @@ -21821,7 +21825,7 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc } nonNum = libc.BoolInt32(i < length) zEnd = zNum + uintptr(i^int32(1)) - zNum += uintptr(int32(enc) & libc.Int32FromInt32(1)) + zNum += uintptr(int32(int32(enc)) & libc.Int32FromInt32(1)) } for zNum < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum)))])&int32(0x01) != 0 { zNum += uintptr(incr) @@ -21849,7 +21853,7 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc if !(v4 && v3 >= int32('0') && c <= int32('9')) { break } - u = u*uint64(10) + uint64(c) - uint64('0') + u = u*uint64(10) + uint64(uint64(c)) - uint64('0') goto _2 _2: ; @@ -21868,9 +21872,9 @@ func _sqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc *(*Ti64)(unsafe.Pointer(pNum)) = v5 } else { if neg != 0 { - *(*Ti64)(unsafe.Pointer(pNum)) = -int64(u) + *(*Ti64)(unsafe.Pointer(pNum)) = -int64(int64(u)) } else { - *(*Ti64)(unsafe.Pointer(pNum)) = int64(u) + *(*Ti64)(unsafe.Pointer(pNum)) = int64(int64(u)) } } rc = 0 @@ -22062,7 +22066,7 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { if !(v4 && v3 >= 0 && c <= int32(9)) { break } - v = v*int64(10) + int64(c) + v = v*int64(10) + int64(int64(c)) goto _2 _2: ; @@ -22076,13 +22080,13 @@ func _sqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) (r int32) { if i > int32(10) { return 0 } - if v-int64(neg) > int64(2147483647) { + if v-int64(int64(neg)) > int64(2147483647) { return 0 } if neg != 0 { v = -v } - *(*int32)(unsafe.Pointer(pValue)) = int32(v) + *(*int32)(unsafe.Pointer(pValue)) = int32(int32(v)) return int32(1) } @@ -22161,33 +22165,33 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun if _sqlite3Config.FbUseLongDouble != 0 { rr = *(*float64)(unsafe.Pointer(bp)) if rr >= float64(1e+19) { - for rr >= libc.Float64FromFloat64(1e+119) { + for float64(float64(rr)) >= libc.Float64FromFloat64(1e+119) { exp += int32(100) - rr = rr * libc.Float64FromFloat64(1e-100) + rr = float64(float64(rr) * libc.Float64FromFloat64(1e-100)) } - for rr >= libc.Float64FromFloat64(1e+29) { + for float64(float64(rr)) >= libc.Float64FromFloat64(1e+29) { exp += int32(10) - rr = rr * libc.Float64FromFloat64(1e-10) + rr = float64(float64(rr) * libc.Float64FromFloat64(1e-10)) } - for rr >= libc.Float64FromFloat64(1e+19) { + for float64(float64(rr)) >= libc.Float64FromFloat64(1e+19) { exp++ - rr = rr * libc.Float64FromFloat64(0.1) + rr = float64(float64(rr) * libc.Float64FromFloat64(0.1)) } } else { - for rr < libc.Float64FromFloat64(1e-97) { + for float64(float64(rr)) < libc.Float64FromFloat64(1e-97) { exp -= int32(100) - rr = rr * libc.Float64FromFloat64(1e+100) + rr = float64(float64(rr) * libc.Float64FromFloat64(1e+100)) } - for rr < libc.Float64FromFloat64(1e+07) { + for float64(float64(rr)) < libc.Float64FromFloat64(1e+07) { exp -= int32(10) - rr = rr * libc.Float64FromFloat64(1e+10) + rr = float64(float64(rr) * libc.Float64FromFloat64(1e+10)) } - for rr < libc.Float64FromFloat64(1e+17) { + for float64(float64(rr)) < libc.Float64FromFloat64(1e+17) { exp-- - rr = rr * libc.Float64FromFloat64(10) + rr = float64(float64(rr) * libc.Float64FromFloat64(10)) } } - *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(rr) + *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(uint64(rr)) } else { (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] = *(*float64)(unsafe.Pointer(bp)) (*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)] = float64(0) @@ -22233,7 +22237,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun *(*int8)(unsafe.Pointer(p + 24 + uintptr(v2))) = int8(*(*Tu64)(unsafe.Pointer(bp + 8))%uint64(10) + uint64('0')) *(*Tu64)(unsafe.Pointer(bp + 8)) /= uint64(10) } - (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(libc.Uint64FromInt64(24) - libc.Uint64FromInt32(1) - uint64(i)) + (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(libc.Uint64FromInt64(24) - libc.Uint64FromInt32(1) - uint64(uint64(i))) (*TFpDecode)(unsafe.Pointer(p)).FiDP = (*TFpDecode)(unsafe.Pointer(p)).Fn + exp if iRound <= 0 { iRound = (*TFpDecode)(unsafe.Pointer(p)).FiDP - iRound @@ -22311,7 +22315,7 @@ func _sqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(pI)) = uint32(0) return 0 } - *(*Tu32)(unsafe.Pointer(pI)) = uint32(v) + *(*Tu32)(unsafe.Pointer(pI)) = uint32(uint32(v)) return int32(1) } @@ -22354,7 +22358,7 @@ func _putVarint64(tls *libc.TLS, p uintptr, v Tu64) (r int32) { var _ /* buf at bp+0 */ [10]Tu8 _, _, _, _, _ = i, j, n, v2, p3 if v&(libc.Uint64FromUint32(0xff000000)<>= uint64(8) i = int32(7) for { @@ -22446,7 +22450,7 @@ func _sqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { b &= uint32(0x7f) b = b << int32(7) a |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(3) } /* CSE1 from below */ @@ -22461,7 +22465,7 @@ func _sqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { /* a &= (0x7f<<14)|(0x7f); */ a = a << int32(7) a |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(4) } /* a: p0<<14 | p2 (masked) */ @@ -22484,7 +22488,7 @@ func _sqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { b = b << int32(7) a |= b s = s >> int32(18) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(18) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(11) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(4) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(3) s |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<= int32(b) { - if int32(a) > int32(b)+int32(49) { + if int32(int32(a)) >= int32(int32(b)) { + if int32(int32(a)) > int32(int32(b))+int32(49) { return a } - if int32(a) > int32(b)+int32(31) { - return int16(int32(a) + int32(1)) + if int32(int32(a)) > int32(int32(b))+int32(31) { + return int16(int32(int32(a)) + int32(1)) } - return int16(int32(a) + int32(_x[int32(a)-int32(b)])) + return int16(int32(int32(a)) + int32(_x[int32(int32(a))-int32(int32(b))])) } else { - if int32(b) > int32(a)+int32(49) { + if int32(int32(b)) > int32(int32(a))+int32(49) { return b } - if int32(b) > int32(a)+int32(31) { - return int16(int32(b) + int32(1)) + if int32(int32(b)) > int32(int32(a))+int32(31) { + return int16(int32(int32(b)) + int32(1)) } - return int16(int32(b) + int32(_x[int32(b)-int32(a)])) + return int16(int32(int32(b)) + int32(_x[int32(int32(b))-int32(int32(a))])) } return r } @@ -22863,9 +22867,9 @@ func _sqlite3LogEst(tls *libc.TLS, x Tu64) (r TLogEst) { } else { i = int32(60) - libc.X__builtin_clzll(tls, x) y = TLogEst(int32(y) + i*libc.Int32FromInt32(10)) - x >>= uint64(i) + x >>= uint64(uint64(i)) } - return int16(int32(_a[x&uint64(7)]) + int32(y) - int32(10)) + return int16(int32(_a[x&uint64(7)]) + int32(int32(y)) - int32(10)) } var _a = [8]TLogEst{ @@ -22899,7 +22903,7 @@ func _sqlite3LogEstFromDouble(tls *libc.TLS, _x float64) (r TLogEst) { } libc.Xmemcpy(tls, bp+8, bp, uint64(8)) e = int16(*(*Tu64)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(52) - uint64(1022)) - return int16(int32(e) * int32(10)) + return int16(int32(int32(e)) * int32(10)) } // C documentation @@ -22911,7 +22915,7 @@ func _sqlite3LogEstToInt(tls *libc.TLS, x TLogEst) (r Tu64) { var n Tu64 var v1 uint64 _, _ = n, v1 - n = uint64(int32(x) % int32(10)) + n = uint64(int32(int32(x)) % int32(10)) x = TLogEst(int32(x) / libc.Int32FromInt32(10)) if n >= uint64(5) { n -= uint64(2) @@ -22920,13 +22924,13 @@ func _sqlite3LogEstToInt(tls *libc.TLS, x TLogEst) (r Tu64) { n -= uint64(1) } } - if int32(x) > int32(60) { + if int32(int32(x)) > int32(60) { return uint64(libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)<= int32(3) { - v1 = (n + uint64(8)) << (int32(x) - int32(3)) + if int32(int32(x)) >= int32(3) { + v1 = (n + uint64(8)) << (int32(int32(x)) - int32(3)) } else { - v1 = (n + uint64(8)) >> (int32(3) - int32(x)) + v1 = (n + uint64(8)) >> (int32(3) - int32(int32(x))) } return v1 } @@ -22984,8 +22988,8 @@ func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa v1 = int64(10) } /* Enlarge the allocation */ - nAlloc = v1 + int64(nInt) - pOut = _sqlite3DbRealloc(tls, db, pIn, uint64(nAlloc)*uint64(4)) + nAlloc = v1 + int64(int64(nInt)) + pOut = _sqlite3DbRealloc(tls, db, pIn, uint64(uint64(nAlloc))*uint64(4)) if pOut == uintptr(0) { return pIn } @@ -22993,14 +22997,14 @@ func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa *(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2) } pIn = pOut - *(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc) + *(*TVList)(unsafe.Pointer(pIn)) = int32(int32(nAlloc)) } i = *(*TVList)(unsafe.Pointer(pIn + 1*4)) *(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal *(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt z = pIn + uintptr(i+int32(2))*4 *(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt - libc.Xmemcpy(tls, z, zName, uint64(nName)) + libc.Xmemcpy(tls, z, zName, uint64(uint64(nName))) *(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0 return pIn } @@ -23046,7 +23050,7 @@ func _sqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int i = int32(2) for cond := true; cond; cond = i < mx { z = pIn + uintptr(i+int32(2))*4 - if libc.Xstrncmp(tls, z, zName, uint64(nName)) == 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0 { + if libc.Xstrncmp(tls, z, zName, uint64(uint64(nName))) == 0 && int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0 { return *(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) } i += *(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) @@ -23192,7 +23196,7 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr var h, v1 uint32 _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ - if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { + if uint64(uint64(new_size))*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } if new_size == (*THash)(unsafe.Pointer(pH)).Fhtsize { @@ -23207,7 +23211,7 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { ** may be larger than the requested amount). */ _sqlite3BeginBenignMalloc(tls) - new_ht = _sqlite3Malloc(tls, uint64(new_size)*uint64(16)) + new_ht = _sqlite3Malloc(tls, uint64(uint64(uint64(new_size))*uint64(16))) _sqlite3EndBenignMalloc(tls) if new_ht == uintptr(0) { return 0 @@ -23217,7 +23221,7 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { v1 = uint32(uint64(_sqlite3MallocSize(tls, new_ht)) / libc.Uint64FromInt64(16)) new_size = v1 (*THash)(unsafe.Pointer(pH)).Fhtsize = v1 - libc.Xmemset(tls, new_ht, 0, uint64(new_size)*uint64(16)) + libc.Xmemset(tls, new_ht, 0, uint64(uint64(new_size))*uint64(16)) elem = (*THash)(unsafe.Pointer(pH)).Ffirst (*THash)(unsafe.Pointer(pH)).Ffirst = libc.UintptrFromInt32(0) for { @@ -24262,7 +24266,7 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc rc = SQLITE_OK i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { break } if _aSyscall[i].FpDefault != 0 { @@ -24279,7 +24283,7 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc */ i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -24315,7 +24319,7 @@ func _unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) (r Tsqli _ = pNotUsed i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(696)/libc.Uint64FromInt64(24)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -24413,7 +24417,7 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { } m2 = v1 for int32(1) != 0 { - fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, z, f|int32(O_CLOEXEC), int32(m2)) + fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, z, f|int32(O_CLOEXEC), int32(int32(m2))) if fd < 0 { if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { continue @@ -24429,7 +24433,7 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3607, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3650, O_RDONLY, int32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3650, O_RDONLY, int32(int32(m))) < 0 { break } } @@ -24494,7 +24498,7 @@ func _robust_ftruncate(tls *libc.TLS, h int32, sz Tsqlite3_int64) (r int32) { var rc int32 _ = rc for cond := true; cond; cond = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { - rc = (*(*func(*libc.TLS, int32, Toff_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(6)].FpCurrent})))(tls, h, sz) + rc = (*(*func(*libc.TLS, int32, Toff_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(6)].FpCurrent})))(tls, h, int64(int64(sz))) } return rc } @@ -24879,7 +24883,7 @@ func _findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) (r int32) { } libc.Xmemset(tls, bp, 0, uint64(16)) (*(*TunixFileId)(unsafe.Pointer(bp))).Fdev = (*(*Tstat)(unsafe.Pointer(bp + 16))).Fst_dev - (*(*TunixFileId)(unsafe.Pointer(bp))).Fino = (*(*Tstat)(unsafe.Pointer(bp + 16))).Fst_ino + (*(*TunixFileId)(unsafe.Pointer(bp))).Fino = uint64((*(*Tstat)(unsafe.Pointer(bp + 16))).Fst_ino) pInode = _inodeList for pInode != 0 && libc.Xmemcmp(tls, bp, pInode, uint64(16)) != 0 { pInode = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext @@ -24921,7 +24925,7 @@ func _fileHasMoved(tls *libc.TLS, pFile uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var _ /* buf at bp+0 */ Tstat - return libc.BoolInt32((*TunixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0) && ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, bp) != 0 || (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino != (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino)) + return libc.BoolInt32((*TunixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0) && ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, bp) != 0 || uint64((*(*Tstat)(unsafe.Pointer(bp))).Fst_ino) != (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino)) } // C documentation @@ -25194,7 +25198,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { v1 = int32(F_WRLCK) } (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(v1) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte) + (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(int64(_sqlite3PendingByte)) if _unixFileLock(tls, pFile, bp) != 0 { tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) rc = _sqliteErrorFromPosixError(tls, tErrno, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(15)< NO_LOCK { - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(uint8(eFileLock)) /* Always update the timestamp on the old file */ libc.Xutimes(tls, zLockFile, libc.UintptrFromInt32(0)) return SQLITE_OK @@ -25637,7 +25643,7 @@ func _dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { return rc } /* got it, set the type and return ok */ - (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) + (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(uint8(eFileLock)) return rc } @@ -25790,7 +25796,7 @@ func _seekAndRead(tls *libc.TLS, id uintptr, offset Tsqlite3_int64, pBuf uintptr _, _ = got, prior prior = 0 for cond := true; cond; cond = got > 0 { - got = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, pBuf, uint64(cnt), offset)) + got = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, pBuf, uint64(uint64(cnt)), int64(int64(offset)))) if got == cnt { break } @@ -25805,7 +25811,7 @@ func _seekAndRead(tls *libc.TLS, id uintptr, offset Tsqlite3_int64, pBuf uintptr } else { if got > 0 { cnt -= got - offset += int64(got) + offset += int64(int64(got)) prior += got pBuf = uintptr(got) + pBuf } @@ -25831,15 +25837,15 @@ func _unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Tsqlit /* Deal with as much of this read request as possible by transferring ** data from the memory mapping using memcpy(). */ if offset < (*TunixFile)(unsafe.Pointer(pFile)).FmmapSize { - if offset+int64(amt) <= (*TunixFile)(unsafe.Pointer(pFile)).FmmapSize { - libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(amt)) + if offset+int64(int64(amt)) <= (*TunixFile)(unsafe.Pointer(pFile)).FmmapSize { + libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(uint64(amt))) return SQLITE_OK } else { nCopy = int32((*TunixFile)(unsafe.Pointer(pFile)).FmmapSize - offset) - libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(nCopy)) + libc.Xmemcpy(tls, pBuf, (*TunixFile)(unsafe.Pointer(pFile)).FpMapRegion+uintptr(offset), uint64(uint64(nCopy))) pBuf = pBuf + uintptr(nCopy) amt -= nCopy - offset += int64(nCopy) + offset += int64(int64(nCopy)) } } got = _seekAndRead(tls, pFile, offset, pBuf, amt) @@ -25888,7 +25894,7 @@ func _seekAndWriteFd(tls *libc.TLS, fd int32, iOff Ti64, pBuf uintptr, nBuf int3 rc = 0 /* Value returned by system call */ nBuf &= int32(0x1ffff) for cond := true; cond; cond = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { - rc = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, pBuf, uint64(nBuf), iOff)) + rc = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, pBuf, uint64(uint64(nBuf)), int64(int64(iOff)))) } if rc < 0 { *(*int32)(unsafe.Pointer(piErrno)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) @@ -25930,7 +25936,7 @@ func _unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Tsqli break } amt -= wrote - offset += int64(wrote) + offset += int64(int64(wrote)) pBuf = pBuf + uintptr(wrote) } if amt > wrote { @@ -26175,7 +26181,7 @@ func _unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { _storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(7)< (*(*Tstat)(unsafe.Pointer(bp))).Fst_size { + if nSize > int64((*(*Tstat)(unsafe.Pointer(bp))).Fst_size) { /* If the OS does not have posix_fallocate(), fake it. Write a ** single byte to the last byte in each block that falls entirely ** within the extended region. Then, if required, a single byte @@ -26218,9 +26224,9 @@ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { */ nBlk = int32((*(*Tstat)(unsafe.Pointer(bp))).Fst_blksize) /* File-system block size */ nWrite = 0 /* Next offset to write to */ - iWrite = (*(*Tstat)(unsafe.Pointer(bp))).Fst_size/int64(nBlk)*int64(nBlk) + int64(nBlk) - int64(1) + iWrite = int64((*(*Tstat)(unsafe.Pointer(bp))).Fst_size/int64(int64(nBlk))*int64(int64(nBlk)) + int64(int64(nBlk)) - int64(1)) for { - if !(iWrite < nSize+int64(nBlk)-int64(1)) { + if !(iWrite < nSize+int64(int64(nBlk))-int64(1)) { break } if iWrite >= nSize { @@ -26233,7 +26239,7 @@ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { goto _1 _1: ; - iWrite += int64(nBlk) + iWrite += int64(int64(nBlk)) } } } @@ -26262,14 +26268,14 @@ func _unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { var p1, p2 uintptr _, _ = p1, p2 if *(*int32)(unsafe.Pointer(pArg)) < 0 { - *(*int32)(unsafe.Pointer(pArg)) = libc.BoolInt32(int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(mask) != 0) + *(*int32)(unsafe.Pointer(pArg)) = libc.BoolInt32(int32((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&int32(int32(mask)) != 0) } else { if *(*int32)(unsafe.Pointer(pArg)) == 0 { p1 = pFile + 30 - *(*uint16)(unsafe.Pointer(p1)) = uint16(int32(*(*uint16)(unsafe.Pointer(p1))) & ^int32(mask)) + *(*uint16)(unsafe.Pointer(p1)) = uint16(int32(*(*uint16)(unsafe.Pointer(p1))) & ^int32(int32(mask))) } else { p2 = pFile + 30 - *(*uint16)(unsafe.Pointer(p2)) = uint16(int32(*(*uint16)(unsafe.Pointer(p2))) | int32(mask)) + *(*uint16)(unsafe.Pointer(p2)) = uint16(int32(*(*uint16)(unsafe.Pointer(p2))) | int32(int32(mask))) } } } @@ -26578,10 +26584,10 @@ func _unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32 /* Locks are within range */ if (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0 { /* Initialize the locking parameters */ - (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(lockType) + (*(*Tflock)(unsafe.Pointer(bp))).Fl_type = int16(int16(lockType)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 - (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(ofst) - (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(n) + (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(int64(ofst)) + (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(int64(n)) res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(7)].FpCurrent})))(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int32(F_SETLK), libc.VaList(bp+40, bp)) if res == -int32(1) { rc = int32(SQLITE_BUSY) @@ -26794,12 +26800,12 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { goto shm_open_err } nShmFilename = int32(6) + int32(libc.Xstrlen(tls, zBasePath)) - pShmNode = Xsqlite3_malloc64(tls, uint64(96)+uint64(nShmFilename)) + pShmNode = Xsqlite3_malloc64(tls, uint64(uint64(96)+uint64(uint64(nShmFilename)))) if pShmNode == uintptr(0) { rc = int32(SQLITE_NOMEM) goto shm_open_err } - libc.Xmemset(tls, pShmNode, 0, uint64(96)+uint64(nShmFilename)) + libc.Xmemset(tls, pShmNode, 0, uint64(96)+uint64(uint64(nShmFilename))) v1 = pShmNode + 1*96 (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FzFilename = v1 zShm = v1 @@ -26855,6 +26861,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -26926,7 +26933,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(19)< iRegion { @@ -27069,7 +27077,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( ** The SQLite core never requests an exclusive lock that it already holds. ** This is assert()ed below. */ - if flags&int32(SQLITE_SHM_UNLOCK) != 0 && (int32((*TunixShm)(unsafe.Pointer(p)).FexclMask)|int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask))&int32(mask) != 0 || flags == libc.Int32FromInt32(SQLITE_SHM_SHARED)|libc.Int32FromInt32(SQLITE_SHM_LOCK) && 0 == int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask)&int32(mask) || flags == libc.Int32FromInt32(SQLITE_SHM_EXCLUSIVE)|libc.Int32FromInt32(SQLITE_SHM_LOCK) { + if flags&int32(SQLITE_SHM_UNLOCK) != 0 && (int32((*TunixShm)(unsafe.Pointer(p)).FexclMask)|int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask))&int32(int32(mask)) != 0 || flags == libc.Int32FromInt32(SQLITE_SHM_SHARED)|libc.Int32FromInt32(SQLITE_SHM_LOCK) && 0 == int32((*TunixShm)(unsafe.Pointer(p)).FsharedMask)&int32(int32(mask)) || flags == libc.Int32FromInt32(SQLITE_SHM_EXCLUSIVE)|libc.Int32FromInt32(SQLITE_SHM_LOCK) { /* Take the required mutexes. In SETLK_TIMEOUT mode (blocking locks), if ** this is an attempt on an exclusive lock use sqlite3_mutex_try(). If any ** other thread is holding this mutex, then it is either holding or about @@ -27099,17 +27107,17 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( bUnlock = 0 *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))-- p1 = p + 18 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^int32(int32(mask))) } } if bUnlock != 0 { rc = _unixShmSystemLock(tls, pDbFd, int32(F_UNLCK), ofst+(libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4), n) if rc == SQLITE_OK { - libc.Xmemset(tls, aLock+uintptr(ofst)*4, 0, uint64(4)*uint64(n)) + libc.Xmemset(tls, aLock+uintptr(ofst)*4, 0, uint64(4)*uint64(uint64(n))) p2 = p + 18 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^int32(int32(mask))) p3 = p + 20 - *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^int32(mask)) + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^int32(int32(mask))) } } } else { @@ -27126,7 +27134,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( /* Get the local shared locks */ if rc == SQLITE_OK { p4 = p + 18 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32(mask)) + *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32(int32(mask))) *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))++ } } else { @@ -27152,7 +27160,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( rc = _unixShmSystemLock(tls, pDbFd, int32(F_WRLCK), ofst+(libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4), n) if rc == SQLITE_OK { p6 = p + 20 - *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | int32(mask)) + *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | int32(int32(mask))) ii = ofst for { if !(ii < ofst+n) { @@ -27186,7 +27194,7 @@ func _unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) ( func _unixShmBarrier(tls *libc.TLS, fd uintptr) { _ = fd _sqlite3MemoryBarrier(tls) /* compiler-defined memory barrier */ - _unixEnterMutex(tls) /* Also mutex, for redundancy */ + _unixEnterMutex(tls) /* Also mutex, for redundancy */ _unixLeaveMutex(tls) } @@ -27290,16 +27298,16 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { if nReuse != nOrig { (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pReq, uint64(nOrig-nReuse)) } - pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, Tsize_t, int32, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(24)].FpCurrent})))(tls, pOrig, uint64(nReuse), uint64(nNew), int32(MREMAP_MAYMOVE), 0) + pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, Tsize_t, int32, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(24)].FpCurrent})))(tls, pOrig, uint64(uint64(nReuse)), uint64(uint64(nNew)), int32(MREMAP_MAYMOVE), 0) zErr = __ccgo_ts + 3567 /* The attempt to extend the existing mapping failed. Free it. */ if pNew == uintptr(-libc.Int32FromInt32(1)) || pNew == uintptr(0) { - (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pOrig, uint64(nReuse)) + (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pOrig, uint64(uint64(nReuse))) } } /* If pNew is still NULL, try to create an entirely new mapping. */ if pNew == uintptr(0) { - pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), uint64(nNew), flags, int32(MAP_SHARED), h, 0) + pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), uint64(uint64(nNew)), flags, int32(MAP_SHARED), h, 0) } if pNew == uintptr(-libc.Int32FromInt32(1)) { pNew = uintptr(0) @@ -27345,7 +27353,7 @@ func _unixMapfile(tls *libc.TLS, pFd uintptr, nMap Ti64) (r int32) { if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(5)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFd)).Fh, bp) != 0 { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(7)< (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeMax { nMap = (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeMax @@ -27388,7 +27396,7 @@ func _unixFetch(tls *libc.TLS, fd uintptr, iOff Ti64, nAmt int32, pp uintptr) (r return rc } } - if (*TunixFile)(unsafe.Pointer(pFd)).FmmapSize >= iOff+int64(nAmt)+int64(nEofBuffer) { + if (*TunixFile)(unsafe.Pointer(pFd)).FmmapSize >= iOff+int64(int64(nAmt))+int64(int64(nEofBuffer)) { *(*uintptr)(unsafe.Pointer(pp)) = (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion + uintptr(iOff) (*TunixFile)(unsafe.Pointer(pFd)).FnFetchOut++ } @@ -27633,7 +27641,7 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam (*TunixFile)(unsafe.Pointer(pNew)).Fh = h (*TunixFile)(unsafe.Pointer(pNew)).FpVfs = pVfs (*TunixFile)(unsafe.Pointer(pNew)).FzPath = zFilename - (*TunixFile)(unsafe.Pointer(pNew)).FctrlFlags = uint16(uint8(ctrlFlags)) + (*TunixFile)(unsafe.Pointer(pNew)).FctrlFlags = uint16(uint8(uint8(ctrlFlags))) (*TunixFile)(unsafe.Pointer(pNew)).FmmapSizeMax = _sqlite3Config.FszMmap if ctrlFlags&int32(UNIXFILE_URI) != 0 { v1 = zFilename @@ -27682,7 +27690,7 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam } else { if pLockingStyle == uintptr(unsafe.Pointer(&_dotlockIoMethods)) { nFilename = int32(libc.Xstrlen(tls, zFilename)) + int32(6) - zLockFile = Xsqlite3_malloc64(tls, uint64(nFilename)) + zLockFile = Xsqlite3_malloc64(tls, uint64(uint64(nFilename))) if zLockFile == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -27744,7 +27752,7 @@ func _unixTempFileDir(tls *libc.TLS) (r uintptr) { if zDir != uintptr(0) && (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zDir, bp) == 0 && (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFDIR) && (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zDir, int32(03)) == 0 { return zDir } - if uint64(i) >= libc.Uint64FromInt64(48)/libc.Uint64FromInt64(8) { + if uint64(uint64(i)) >= libc.Uint64FromInt64(48)/libc.Uint64FromInt64(8) { break } v1 = i @@ -27835,7 +27843,7 @@ func _findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) (r uintptr) { ** not searching for a reusable file descriptor are not dire. */ if _inodeList != uintptr(0) && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(4)].FpCurrent})))(tls, zPath, bp) { pInode = _inodeList - for pInode != 0 && ((*TunixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fdev != (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev || (*TunixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fino != (*(*Tstat)(unsafe.Pointer(bp))).Fst_ino) { + for pInode != 0 && ((*TunixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fdev != (*(*Tstat)(unsafe.Pointer(bp))).Fst_dev || (*TunixInodeInfo)(unsafe.Pointer(pInode)).FfileId.Fino != uint64((*(*Tstat)(unsafe.Pointer(bp))).Fst_ino)) { pInode = (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpNext } if pInode != 0 { @@ -27940,7 +27948,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt nDb = _sqlite3Strlen30(tls, zPath) - int32(1) for nDb > 0 && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) != int32('.') { if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) == int32('-') { - libc.Xmemcpy(tls, bp, zPath, uint64(nDb)) + libc.Xmemcpy(tls, bp, zPath, uint64(uint64(nDb))) (*(*[513]int8)(unsafe.Pointer(bp)))[nDb] = int8('\000') rc = _getFileMode(tls, bp, pMode, pUid, pGid) break @@ -28154,6 +28162,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags ctrlFlags |= int32(UNIXFILE_URI) } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -28290,7 +28299,7 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ *(*int8)(unsafe.Pointer((*TDbPath)(unsafe.Pointer(pPath)).FzOut + uintptr(v3))) = int8('/') - libc.Xmemcpy(tls, (*TDbPath)(unsafe.Pointer(pPath)).FzOut+uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed), zName, uint64(nName)) + libc.Xmemcpy(tls, (*TDbPath)(unsafe.Pointer(pPath)).FzOut+uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed), zName, uint64(uint64(nName))) *(*int32)(unsafe.Pointer(pPath + 20)) += nName if (*TDbPath)(unsafe.Pointer(pPath)).Frc == SQLITE_OK { *(*int8)(unsafe.Pointer((*TDbPath)(unsafe.Pointer(pPath)).FzOut + uintptr((*TDbPath)(unsafe.Pointer(pPath)).FnUsed))) = 0 @@ -28468,7 +28477,7 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( ** that we always use the same random number sequence. This makes the ** tests repeatable. */ - libc.Xmemset(tls, zBuf, 0, uint64(nBuf)) + libc.Xmemset(tls, zBuf, 0, uint64(uint64(nBuf))) libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_randomnessPid)), libc.Xgetpid(tls)) fd = _robust_open(tls, __ccgo_ts+3930, O_RDONLY, uint32(0)) if fd < 0 { @@ -28479,7 +28488,7 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( nBuf = int32(libc.Uint64FromInt64(8) + libc.Uint64FromInt64(4)) } else { for cond := true; cond; cond = got < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { - got = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(8)].FpCurrent})))(tls, fd, zBuf, uint64(nBuf))) + got = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(8)].FpCurrent})))(tls, fd, zBuf, uint64(uint64(nBuf)))) } _robust_close(tls, uintptr(0), fd, int32(44857)) } @@ -28537,7 +28546,7 @@ func _unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) (r int _ = rc rc = SQLITE_OK libc.Xgettimeofday(tls, bp, uintptr(0)) /* Cannot fail given valid arguments */ - *(*Tsqlite3_int64)(unsafe.Pointer(piNow)) = _unixEpoch + int64(1000)*(*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_sec + (*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_usec/int64(1000) + *(*Tsqlite3_int64)(unsafe.Pointer(piNow)) = _unixEpoch + int64(1000)*int64((*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_sec) + int64((*(*Ttimeval)(unsafe.Pointer(bp))).Ftv_usec/int64(1000)) _ = NotUsed return rc } @@ -28768,7 +28777,7 @@ func Xsqlite3_os_init(tls *libc.TLS) (r int32) { /* Register all VFSes defined in the aVfs[] array */ i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(672)/libc.Uint64FromInt64(168)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(672)/libc.Uint64FromInt64(168)) { break } Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&_aVfs))+uintptr(i)*168, libc.BoolInt32(i == uint32(0))) @@ -29246,15 +29255,15 @@ func _memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Ts _ = p p = (*TMemFile)(unsafe.Pointer(pFile)).FpStore _memdbEnter(tls, p) - if iOfst+int64(iAmt) > (*TMemStore)(unsafe.Pointer(p)).Fsz { - libc.Xmemset(tls, zBuf, 0, uint64(iAmt)) + if iOfst+int64(int64(iAmt)) > (*TMemStore)(unsafe.Pointer(p)).Fsz { + libc.Xmemset(tls, zBuf, 0, uint64(uint64(iAmt))) if iOfst < (*TMemStore)(unsafe.Pointer(p)).Fsz { libc.Xmemcpy(tls, zBuf, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), uint64((*TMemStore)(unsafe.Pointer(p)).Fsz-iOfst)) } _memdbLeave(tls, p) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(2)< (*TMemStore)(unsafe.Pointer(p)).FszMax { newSz = (*TMemStore)(unsafe.Pointer(p)).FszMax } - pNew = _sqlite3Realloc(tls, (*TMemStore)(unsafe.Pointer(p)).FaData, uint64(newSz)) + pNew = _sqlite3Realloc(tls, (*TMemStore)(unsafe.Pointer(p)).FaData, uint64(uint64(newSz))) if pNew == uintptr(0) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)< (*TMemStore)(unsafe.Pointer(p)).Fsz { - if v2 = iOfst+int64(iAmt) > (*TMemStore)(unsafe.Pointer(p)).FszAlloc; v2 { - v1 = _memdbEnlarge(tls, p, iOfst+int64(iAmt)) + if iOfst+int64(int64(iAmt)) > (*TMemStore)(unsafe.Pointer(p)).Fsz { + if v2 = iOfst+int64(int64(iAmt)) > (*TMemStore)(unsafe.Pointer(p)).FszAlloc; v2 { + v1 = _memdbEnlarge(tls, p, iOfst+int64(int64(iAmt))) rc = v1 } if v2 && v1 != SQLITE_OK { @@ -29316,9 +29325,9 @@ func _memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Tsql if iOfst > (*TMemStore)(unsafe.Pointer(p)).Fsz { libc.Xmemset(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr((*TMemStore)(unsafe.Pointer(p)).Fsz), 0, uint64(iOfst-(*TMemStore)(unsafe.Pointer(p)).Fsz)) } - (*TMemStore)(unsafe.Pointer(p)).Fsz = iOfst + int64(iAmt) + (*TMemStore)(unsafe.Pointer(p)).Fsz = iOfst + int64(int64(iAmt)) } - libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, uint64(iAmt)) + libc.Xmemcpy(tls, (*TMemStore)(unsafe.Pointer(p)).FaData+uintptr(iOfst), z, uint64(uint64(iAmt))) _memdbLeave(tls, p) return SQLITE_OK } @@ -29512,7 +29521,7 @@ func _memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Tsqlite3_int64, iAmt int32, _ = p p = (*TMemFile)(unsafe.Pointer(pFile)).FpStore _memdbEnter(tls, p) - if iOfst+int64(iAmt) > (*TMemStore)(unsafe.Pointer(p)).Fsz || (*TMemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) != uint32(0) { + if iOfst+int64(int64(iAmt)) > (*TMemStore)(unsafe.Pointer(p)).Fsz || (*TMemStore)(unsafe.Pointer(p)).FmFlags&uint32(SQLITE_DESERIALIZE_RESIZEABLE) != uint32(0) { *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) } else { (*TMemStore)(unsafe.Pointer(p)).FnMmap++ @@ -29569,12 +29578,12 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i i++ } if p == uintptr(0) { - p = _sqlite3Malloc(tls, uint64(72)+uint64(szName)+uint64(3)) + p = _sqlite3Malloc(tls, uint64(uint64(72)+uint64(uint64(szName))+uint64(3))) if p == uintptr(0) { Xsqlite3_mutex_leave(tls, pVfsMutex) return int32(SQLITE_NOMEM) } - apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(8)*uint64(_memdb_g.FnMemStore+libc.Int32FromInt32(1))) + apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(uint64(8)*uint64(_memdb_g.FnMemStore+libc.Int32FromInt32(1)))) if apNew == uintptr(0) { Xsqlite3_free(tls, p) Xsqlite3_mutex_leave(tls, pVfsMutex) @@ -29811,13 +29820,13 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if rc != int32(SQLITE_ROW) { pOut = uintptr(0) } else { - sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) + sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(int64(szPage)) if sz == 0 { Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) Xsqlite3_exec(tls, db, __ccgo_ts+4015, uintptr(0), uintptr(0), uintptr(0)) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == int32(SQLITE_ROW) { - sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) + sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(int64(szPage)) } } if piSize != 0 { @@ -29826,7 +29835,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if mFlags&uint32(SQLITE_SERIALIZE_NOCOPY) != 0 { pOut = uintptr(0) } else { - pOut = Xsqlite3_malloc64(tls, uint64(sz)) + pOut = Xsqlite3_malloc64(tls, uint64(uint64(sz))) if pOut != 0 { nPage = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pPager = _sqlite3BtreePager(tls, pBt) @@ -29836,12 +29845,12 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp break } *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - pTo = pOut + uintptr(int64(szPage)*int64(pgno-libc.Int32FromInt32(1))) - rc = _sqlite3PagerGet(tls, pPager, uint32(pgno), bp+8, 0) + pTo = pOut + uintptr(int64(int64(szPage))*int64(pgno-libc.Int32FromInt32(1))) + rc = _sqlite3PagerGet(tls, pPager, uint32(uint32(pgno)), bp+8, 0) if rc == SQLITE_OK { - libc.Xmemcpy(tls, pTo, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 8))), uint64(szPage)) + libc.Xmemcpy(tls, pTo, _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 8))), uint64(uint64(szPage))) } else { - libc.Xmemset(tls, pTo, 0, uint64(szPage)) + libc.Xmemset(tls, pTo, 0, uint64(uint64(szPage))) } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) goto _2 @@ -29887,7 +29896,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint if rc != 0 { goto end_deserialize } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(uint8(iDb)) libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(1), 2, 0x4) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 2, 0x4) @@ -29911,6 +29920,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -29950,10 +29960,10 @@ func _sqlite3MemdbInit(tls *libc.TLS) (r int32) { ** Windows x86 and SQLITE_MAX_MMAP_SIZE=0. We always leave ** it in, to be safe, but it is marked as NO_TEST since there ** is no way to reach it under most builds. */ - if uint64(sz) < uint64(24) { + if uint64(uint64(sz)) < uint64(24) { sz = uint32(24) } /*NO_TEST*/ - _memdb_vfs.FszOsFile = int32(sz) + _memdb_vfs.FszOsFile = int32(int32(sz)) return Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&_memdb_vfs)), 0) } @@ -30172,13 +30182,14 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { return SQLITE_OK } h++ - if uint64(h) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4) { + if uint64(uint64(h)) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4) { h = uint32(0) } } /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -30192,7 +30203,7 @@ bitvec_set_rehash: rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { - if !(uint64(j) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)) { + if !(uint64(uint64(j)) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)) { break } if *(*Tu32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0 { @@ -30207,6 +30218,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -30249,7 +30261,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { (*TBitvec)(unsafe.Pointer(p)).FnSet = uint32(0) j = uint32(0) for { - if !(uint64(j) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)) { + if !(uint64(uint64(j)) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)) { break } if *(*Tu32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0 && *(*Tu32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != i+uint32(1) { @@ -30257,7 +30269,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { (*TBitvec)(unsafe.Pointer(p)).FnSet++ for *(*Tu32)(unsafe.Pointer(p + 16 + uintptr(h)*4)) != 0 { h++ - if uint64(h) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4) { + if uint64(uint64(h)) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4) { h = uint32(0) } } @@ -30285,7 +30297,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(uint64(uint64(i)) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30359,7 +30371,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { rc = -int32(1) /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ - pBitvec = _sqlite3BitvecCreate(tls, uint32(sz)) + pBitvec = _sqlite3BitvecCreate(tls, uint32(uint32(sz))) pV = _sqlite3MallocZero(tls, uint64((sz+int32(7))/int32(8)+int32(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { @@ -30423,7 +30435,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { ** match (rc==0). Change rc to non-zero if a discrepancy ** is found. */ - rc = int32(uint32(_sqlite3BitvecTest(tls, uintptr(0), uint32(0))+_sqlite3BitvecTest(tls, pBitvec, uint32(sz+int32(1)))+_sqlite3BitvecTest(tls, pBitvec, uint32(0))) + (_sqlite3BitvecSize(tls, pBitvec) - uint32(sz))) + rc = int32(uint32(_sqlite3BitvecTest(tls, uintptr(0), uint32(0))+_sqlite3BitvecTest(tls, pBitvec, uint32(sz+int32(1)))+_sqlite3BitvecTest(tls, pBitvec, uint32(0))) + (_sqlite3BitvecSize(tls, pBitvec) - uint32(uint32(sz)))) *(*int32)(unsafe.Pointer(bp)) = int32(1) for { if !(*(*int32)(unsafe.Pointer(bp)) <= sz) { @@ -30439,6 +30451,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -30548,7 +30561,7 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { var p uintptr _ = p p = (*TPgHdr)(unsafe.Pointer(pPage)).FpCache - if int32(addRemove)&int32(PCACHE_DIRTYLIST_REMOVE) != 0 { + if int32(int32(addRemove))&int32(PCACHE_DIRTYLIST_REMOVE) != 0 { /* Update the PCache1.pSynced variable if necessary. */ if (*TPCache)(unsafe.Pointer(p)).FpSynced == pPage { (*TPCache)(unsafe.Pointer(p)).FpSynced = (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev @@ -30571,7 +30584,7 @@ func _pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove Tu8) { } } } - if int32(addRemove)&int32(PCACHE_DIRTYLIST_ADD) != 0 { + if int32(int32(addRemove))&int32(PCACHE_DIRTYLIST_ADD) != 0 { (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyPrev = uintptr(0) (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext = (*TPCache)(unsafe.Pointer(p)).FpDirty if (*TPgHdr)(unsafe.Pointer(pPage)).FpDirtyNext != 0 { @@ -30628,7 +30641,7 @@ func _numberOfCachePages(tls *libc.TLS, p uintptr) (r int32) { if n > int64(1000000000) { n = int64(1000000000) } - return int32(n) + return int32(int32(n)) } return r } @@ -30685,7 +30698,7 @@ func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ - (*TPCache)(unsafe.Pointer(p)).FbPurgeable = uint8(bPurgeable) + (*TPCache)(unsafe.Pointer(p)).FbPurgeable = uint8(uint8(bPurgeable)) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) (*TPCache)(unsafe.Pointer(p)).FxStress = xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress @@ -31294,7 +31307,7 @@ func _sqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) (r int32 _ = res if mxPage != 0 { if mxPage < 0 { - mxPage = int32(int64(-libc.Int32FromInt32(1024)) * int64(mxPage) / int64((*TPCache)(unsafe.Pointer(p)).FszPage+(*TPCache)(unsafe.Pointer(p)).FszExtra)) + mxPage = int32(int64(-libc.Int32FromInt32(1024)) * int64(int64(mxPage)) / int64((*TPCache)(unsafe.Pointer(p)).FszPage+(*TPCache)(unsafe.Pointer(p)).FszExtra)) } (*TPCache)(unsafe.Pointer(p)).FszSpill = mxPage } @@ -31348,7 +31361,7 @@ func _sqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) (r int32) { pDirty = (*TPgHdr)(unsafe.Pointer(pDirty)).FpDirtyNext } if nCache != 0 { - v2 = int32(int64(nDirty) * libc.Int64FromInt32(100) / int64(nCache)) + v2 = int32(int64(int64(nDirty)) * libc.Int64FromInt32(100) / int64(int64(nCache))) } else { v2 = 0 } @@ -31678,7 +31691,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -31743,7 +31756,7 @@ func _pcache1InitBulk(tls *libc.TLS, pCache uintptr) (r int32) { if szBulk > int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc)*int64((*TPCache1)(unsafe.Pointer(pCache)).FnMax) { szBulk = int64((*TPCache1)(unsafe.Pointer(pCache)).FszAlloc) * int64((*TPCache1)(unsafe.Pointer(pCache)).FnMax) } - v1 = _sqlite3Malloc(tls, uint64(szBulk)) + v1 = _sqlite3Malloc(tls, uint64(uint64(szBulk))) (*TPCache1)(unsafe.Pointer(pCache)).FpBulk = v1 zBulk = v1 _sqlite3EndBenignMalloc(tls) @@ -31804,7 +31817,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { /* Memory is not available in the SQLITE_CONFIG_PAGECACHE pool. Get ** it from sqlite3Malloc instead. */ - p = _sqlite3Malloc(tls, uint64(nByte)) + p = _sqlite3Malloc(tls, uint64(uint64(nByte))) if p != 0 { sz = _sqlite3MallocSize(tls, p) Xsqlite3_mutex_enter(tls, _pcache1_g.Fmutex) @@ -31993,7 +32006,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(uint64(8)*uint64(uint64(nNew)))) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -32199,7 +32212,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -32227,7 +32240,7 @@ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32 var sz, v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ sz = int32(uint64(88) + uint64(80)*uint64(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, uint64(sz)) + pCache = _sqlite3MallocZero(tls, uint64(uint64(sz))) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -32285,7 +32298,7 @@ func _pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { if (*TPCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { pGroup = (*TPCache1)(unsafe.Pointer(pCache)).FpGroup Xsqlite3_mutex_enter(tls, (*TPGroup)(unsafe.Pointer(pGroup)).Fmutex) - n = uint32(nMax) + n = uint32(uint32(nMax)) if n > uint32(0x7fff0000)-(*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage+(*TPCache1)(unsafe.Pointer(pCache)).FnMax { n = uint32(0x7fff0000) - (*TPGroup)(unsafe.Pointer(pGroup)).FnMaxPage + (*TPCache1)(unsafe.Pointer(pCache)).FnMax } @@ -32855,7 +32868,7 @@ func _sqlite3RowSetInit(tls *libc.TLS, db uintptr) (r uintptr) { (*TRowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*TRowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) (*TRowSet)(unsafe.Pointer(p)).FpFresh = uintptr((libc.Uint64FromInt64(56)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) + p - (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16((uint64(N) - (libc.Uint64FromInt64(56)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) / libc.Uint64FromInt64(24)) + (*TRowSet)(unsafe.Pointer(p)).FnFresh = uint16((uint64(uint64(N)) - (libc.Uint64FromInt64(56)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) / libc.Uint64FromInt64(24)) (*TRowSet)(unsafe.Pointer(p)).FrsFlags = uint16(ROWSET_SORTED) (*TRowSet)(unsafe.Pointer(p)).FiBatch = 0 } @@ -33046,7 +33059,7 @@ func _rowSetEntrySort(tls *libc.TLS, pIn uintptr) (r uintptr) { pIn = (*(*[40]uintptr)(unsafe.Pointer(bp)))[0] i = uint32(1) for { - if !(uint64(i) < libc.Uint64FromInt64(320)/libc.Uint64FromInt64(8)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(320)/libc.Uint64FromInt64(8)) { break } if (*(*[40]uintptr)(unsafe.Pointer(bp)))[i] == uintptr(0) { @@ -34282,7 +34295,7 @@ func _pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) (r int32) { } rc = v1 if int32((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) { - (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(eLock) + (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(uint8(eLock)) } } (*TPager)(unsafe.Pointer(pPager)).FchangeCountDone = (*TPager)(unsafe.Pointer(pPager)).FtempFile /* ticket fb3b3024ea238d5c */ @@ -34313,7 +34326,7 @@ func _pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) (r int32) { } rc = v1 if rc == SQLITE_OK && (int32((*TPager)(unsafe.Pointer(pPager)).FeLock) != libc.Int32FromInt32(EXCLUSIVE_LOCK)+libc.Int32FromInt32(1) || eLock == int32(EXCLUSIVE_LOCK)) { - (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(eLock) + (*TPager)(unsafe.Pointer(pPager)).FeLock = uint8(uint8(eLock)) } } return rc @@ -34615,7 +34628,7 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { ** the memory prevents valgrind from complaining, so we are willing to ** take the performance hit. */ - libc.Xmemset(tls, zHeader+uintptr(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(20)), 0, uint64(nHeader)-(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(20))) + libc.Xmemset(tls, zHeader+uintptr(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(20)), 0, uint64(uint64(nHeader))-(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(20))) /* In theory, it is only necessary to write the 28 bytes that the ** journal header consumes to the journal file here. Then increment the ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next @@ -34638,8 +34651,8 @@ func _writeJournalHdr(tls *libc.TLS, pPager uintptr) (r int32) { if !(rc == SQLITE_OK && nWrite < (*TPager)(unsafe.Pointer(pPager)).FsectorSize) { break } - rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(nHeader), (*TPager)(unsafe.Pointer(pPager)).FjournalOff) - *(*Ti64)(unsafe.Pointer(pPager + 96)) += int64(nHeader) + rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(int32(nHeader)), (*TPager)(unsafe.Pointer(pPager)).FjournalOff) + *(*Ti64)(unsafe.Pointer(pPager + 96)) += int64(int64(nHeader)) goto _3 _3: ; @@ -34831,15 +34844,15 @@ func _writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) rc = v3 } if v6 = v4 || 0 != v3; !v6 { - v5 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(nSuper), uint32(nSuper)) + v5 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(int64(nSuper)), uint32(uint32(nSuper))) rc = v5 } if v8 = v6 || 0 != v5; !v8 { - v7 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(nSuper)+int64(4), cksum) + v7 = _write32bits(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff+int64(4)+int64(int64(nSuper))+int64(4), cksum) rc = v7 } if v10 = v8 || 0 != v7; !v10 { - v9 = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&_aJournalMagic)), int32(8), iHdrOff+int64(4)+int64(nSuper)+int64(8)) + v9 = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&_aJournalMagic)), int32(8), iHdrOff+int64(4)+int64(int64(nSuper))+int64(8)) rc = v9 } if v10 || 0 != v9 { @@ -35649,7 +35662,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { goto delsuper_out } nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(int64(nSuperPtr))+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out @@ -35670,7 +35683,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { *(*int8)(unsafe.Pointer(zSuperJournal + uintptr(*(*Ti64)(unsafe.Pointer(bp))))) = 0 *(*int8)(unsafe.Pointer(zSuperJournal + uintptr(*(*Ti64)(unsafe.Pointer(bp))+int64(1)))) = 0 zJournal = zSuperJournal - for int64(zJournal)-int64(zSuperJournal) < *(*Ti64)(unsafe.Pointer(bp)) { + for int64(int64(int64(zJournal))-int64(int64(zSuperJournal))) < *(*Ti64)(unsafe.Pointer(bp)) { rc = _sqlite3OsAccess(tls, pVfs, zJournal, SQLITE_ACCESS_EXISTS, bp+8) if rc != SQLITE_OK { goto delsuper_out @@ -35681,7 +35694,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint32(uint32(nSuperPtr))) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35696,6 +35709,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -35741,16 +35755,16 @@ func _pager_truncate(tls *libc.TLS, pPager uintptr, nPage TPgno) (r int32) { szPage = int32((*TPager)(unsafe.Pointer(pPager)).FpageSize) /* TODO: Is it safe to use Pager.dbFileSize here? */ rc = _sqlite3OsFileSize(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, bp) - *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(szPage) * int64(nPage) + *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(int64(szPage)) * int64(int64(nPage)) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp)) != *(*Ti64)(unsafe.Pointer(bp + 8)) { if *(*Ti64)(unsafe.Pointer(bp)) > *(*Ti64)(unsafe.Pointer(bp + 8)) { rc = _sqlite3OsTruncate(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, *(*Ti64)(unsafe.Pointer(bp + 8))) } else { - if *(*Ti64)(unsafe.Pointer(bp))+int64(szPage) <= *(*Ti64)(unsafe.Pointer(bp + 8)) { + if *(*Ti64)(unsafe.Pointer(bp))+int64(int64(szPage)) <= *(*Ti64)(unsafe.Pointer(bp + 8)) { pTmp = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - libc.Xmemset(tls, pTmp, 0, uint64(szPage)) + libc.Xmemset(tls, pTmp, 0, uint64(uint64(szPage))) _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_SIZE_HINT), bp+8) - rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(szPage)) + rc = _sqlite3OsWrite(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(int64(szPage))) } } if rc == SQLITE_OK { @@ -36023,6 +36037,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -36099,7 +36114,7 @@ func _readDbPage(tls *libc.TLS, pPg uintptr) (r int32) { _, _, _, _ = dbFileVers, iOffset, pPager, rc pPager = (*TPgHdr)(unsafe.Pointer(pPg)).FpPager /* Pager object associated with page pPg */ rc = SQLITE_OK /* Return code */ - *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) /* Frame of WAL containing pgno */ + *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) /* Frame of WAL containing pgno */ if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno, bp) if rc != 0 { @@ -36279,7 +36294,7 @@ func _pagerWalFrames(tls *libc.TLS, pPager uintptr, _pList uintptr, nTruncate TP } else { nList = int32(1) } - *(*Tu32)(unsafe.Pointer(pPager + 248 + 2*4)) += uint32(nList) + *(*Tu32)(unsafe.Pointer(pPager + 248 + 2*4)) += uint32(uint32(nList)) if (*TPgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fpgno == uint32(1) { _pager_write_changecounter(tls, *(*uintptr)(unsafe.Pointer(bp))) } @@ -36890,14 +36905,14 @@ func _sqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, } if rc == SQLITE_OK { _pager_reset(tls, pPager) - rc = _sqlite3PcacheSetPageSize(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, int32(pageSize)) + rc = _sqlite3PcacheSetPageSize(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, int32(int32(pageSize))) } if rc == SQLITE_OK { _sqlite3PageFree(tls, (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace) (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace = pNew - (*TPager)(unsafe.Pointer(pPager)).FdbSize = uint32((*(*Ti64)(unsafe.Pointer(bp)) + int64(pageSize) - libc.Int64FromInt32(1)) / int64(pageSize)) - (*TPager)(unsafe.Pointer(pPager)).FpageSize = int64(pageSize) - (*TPager)(unsafe.Pointer(pPager)).FlckPgno = uint32(_sqlite3PendingByte)/pageSize + uint32(1) + (*TPager)(unsafe.Pointer(pPager)).FdbSize = uint32((*(*Ti64)(unsafe.Pointer(bp)) + int64(int64(pageSize)) - libc.Int64FromInt32(1)) / int64(int64(pageSize))) + (*TPager)(unsafe.Pointer(pPager)).FpageSize = int64(int64(pageSize)) + (*TPager)(unsafe.Pointer(pPager)).FlckPgno = uint32(uint32(_sqlite3PendingByte))/pageSize + uint32(1) } else { _sqlite3PageFree(tls, pNew) } @@ -36907,7 +36922,7 @@ func _sqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, if nReserve < 0 { nReserve = int32((*TPager)(unsafe.Pointer(pPager)).FnReserve) } - (*TPager)(unsafe.Pointer(pPager)).FnReserve = int16(nReserve) + (*TPager)(unsafe.Pointer(pPager)).FnReserve = int16(int16(nReserve)) _pagerFixMaplimit(tls, pPager) } return rc @@ -36977,7 +36992,7 @@ func _sqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u var rc int32 _ = rc rc = SQLITE_OK - libc.Xmemset(tls, pDest, 0, uint64(N)) + libc.Xmemset(tls, pDest, 0, uint64(uint64(N))) /* This routine is only called by btree immediately after creating ** the Pager object. There has not been an opportunity to transition ** to WAL mode yet. @@ -37134,7 +37149,7 @@ func _pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno TPgno, pData uintp (*TPgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0) libc.Xmemset(tls, (*TPgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint64(8)) } else { - v2 = _sqlite3MallocZero(tls, uint64(80)+uint64((*TPager)(unsafe.Pointer(pPager)).FnExtra)) + v2 = _sqlite3MallocZero(tls, uint64(uint64(80)+uint64((*TPager)(unsafe.Pointer(pPager)).FnExtra))) p = v2 *(*uintptr)(unsafe.Pointer(ppPage)) = v2 if p == uintptr(0) { @@ -37783,7 +37798,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u z += uintptr(libc.Xstrlen(tls, z) + uint64(1)) z += uintptr(libc.Xstrlen(tls, z) + uint64(1)) } - nUriByte = int32(t__predefined_ptrdiff_t(z+1) - int64(zUri)) + nUriByte = int32(t__predefined_ptrdiff_t(z+1) - int64(int64(zUri))) if rc == SQLITE_OK && nPathname+int32(8) > (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname { /* This branch is taken when the journal path required by ** the database being opened will be more than pVfs->mxPathname @@ -37842,7 +37857,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))+uint64((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+uint64(nPathname)+uint64(1)+uint64(nUriByte)+uint64(nPathname)+uint64(8)+uint64(1)+uint64(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))+uint64((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+uint64(uint64(nPathname))+uint64(1)+uint64(uint64(nUriByte))+uint64(uint64(nPathname))+uint64(8)+uint64(1)+uint64(uint64(nPathname))+uint64(4)+uint64(1)+uint64(3))) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37863,10 +37878,10 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u pPtr += uintptr(4) /* Skip zero prefix */ (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename = pPtr if nPathname > 0 { - libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, uint64(uint64(nPathname))) pPtr += uintptr(nPathname + int32(1)) if zUri != 0 { - libc.Xmemcpy(tls, pPtr, zUri, uint64(nUriByte)) + libc.Xmemcpy(tls, pPtr, zUri, uint64(uint64(nUriByte))) pPtr += uintptr(nUriByte) } else { pPtr++ @@ -37875,7 +37890,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u /* Fill in Pager.zJournal */ if nPathname > 0 { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr - libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, uint64(uint64(nPathname))) pPtr += uintptr(nPathname) libc.Xmemcpy(tls, pPtr, __ccgo_ts+4082, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) @@ -37885,7 +37900,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u /* Fill in Pager.zWal */ if nPathname > 0 { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr - libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) + libc.Xmemcpy(tls, pPtr, zPathname, uint64(uint64(nPathname))) pPtr += uintptr(nPathname) libc.Xmemcpy(tls, pPtr, __ccgo_ts+4091, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) @@ -37897,7 +37912,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u _sqlite3DbFree(tls, uintptr(0), zPathname) } (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpVfs = pVfs - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FvfsFlags = uint32(vfsFlags) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FvfsFlags = uint32(uint32(vfsFlags)) /* Open the pager file. */ if !(zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0) { @@ -37948,6 +37963,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -37981,7 +37997,7 @@ _3: Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FuseJournal = uint8(useJournal) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FuseJournal = uint8(uint8(useJournal)) /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ @@ -37991,16 +38007,16 @@ _3: (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmxPgno = uint32(SQLITE_MAX_PAGE_COUNT) /* pPager->state = PAGER_UNLOCK; */ /* pPager->errMask = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile = uint8(tempFile) - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexclusiveMode = uint8(tempFile) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile = uint8(uint8(tempFile)) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexclusiveMode = uint8(uint8(tempFile)) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FchangeCountDone = (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtempFile - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemDb = uint8(memDb) - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FreadOnly = uint8(readOnly) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FmemDb = uint8(uint8(memDb)) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FreadOnly = uint8(uint8(readOnly)) _sqlite3PagerSetFlags(tls, *(*uintptr)(unsafe.Pointer(bp)), uint32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS)+libc.Int32FromInt32(1)|libc.Int32FromInt32(PAGER_CACHESPILL))) /* pPager->pFirst = 0; */ /* pPager->pFirstSynced = 0; */ /* pPager->pLast = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExtra = uint16(nExtra) + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExtra = uint16(uint16(nExtra)) (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FjournalSizeLimit = int64(-int32(1)) _setSectorSize(tls, *(*uintptr)(unsafe.Pointer(bp))) if !(useJournal != 0) { @@ -38345,6 +38361,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -38510,6 +38527,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -38773,7 +38791,7 @@ func _sqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor if (*TPager)(unsafe.Pointer(pPager)).FerrCode != 0 { return (*TPager)(unsafe.Pointer(pPager)).FerrCode } - (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory = uint8(subjInMemory) + (*TPager)(unsafe.Pointer(pPager)).FsubjInMemory = uint8(uint8(subjInMemory)) if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_READER) { if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { /* If the pager is configured to use locking_mode=exclusive, and an @@ -38986,7 +39004,7 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { if pg1+nPagePerSector-uint32(1) > nPageCount { nPage = int32(nPageCount + uint32(1) - pg1) } else { - nPage = int32(nPagePerSector) + nPage = int32(int32(nPagePerSector)) } } ii = 0 @@ -38994,7 +39012,7 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { if !(ii < nPage && rc == SQLITE_OK) { break } - pg = pg1 + uint32(ii) + pg = pg1 + uint32(uint32(ii)) if pg == (*TPgHdr)(unsafe.Pointer(pPg)).Fpgno || !(_sqlite3BitvecTest(tls, (*TPager)(unsafe.Pointer(pPager)).FpInJournal, pg) != 0) { if pg != (*TPager)(unsafe.Pointer(pPager)).FlckPgno { rc = _sqlite3PagerGet(tls, pPager, pg, bp, 0) @@ -39033,7 +39051,7 @@ func _pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) (r int32) { if !(ii < nPage) { break } - pPage1 = _sqlite3PagerLookup(tls, pPager, pg1+uint32(ii)) + pPage1 = _sqlite3PagerLookup(tls, pPager, pg1+uint32(uint32(ii))) if pPage1 != 0 { p5 = pPage1 + 52 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39392,6 +39410,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -39603,7 +39622,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*uint64(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*uint64(uint64(nSavepoint)))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -39985,7 +40004,7 @@ func _sqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) (r uintptr) { // */ func _sqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) (r int32) { if eMode >= 0 && !((*TPager)(unsafe.Pointer(pPager)).FtempFile != 0) && !(_sqlite3WalHeapMemory(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) != 0) { - (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode = uint8(eMode) + (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode = uint8(uint8(eMode)) } return int32((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode) } @@ -40027,17 +40046,17 @@ func _sqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) (r */ if (*TPager)(unsafe.Pointer(pPager)).FmemDb != 0 { if eMode != int32(PAGER_JOURNALMODE_MEMORY) && eMode != int32(PAGER_JOURNALMODE_OFF) { - eMode = int32(eOld) + eMode = int32(int32(eOld)) } } - if eMode != int32(eOld) { + if eMode != int32(int32(eOld)) { /* Change the journal mode. */ - (*TPager)(unsafe.Pointer(pPager)).FjournalMode = uint8(eMode) + (*TPager)(unsafe.Pointer(pPager)).FjournalMode = uint8(uint8(eMode)) /* When transitioning from TRUNCATE or PERSIST to any other journal ** mode except WAL, unless the pager is in locking_mode=exclusive mode, ** delete the journal file. */ - if !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && int32(eOld)&int32(5) == int32(1) && eMode&int32(1) == 0 { + if !((*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && int32(int32(eOld))&int32(5) == int32(1) && eMode&int32(1) == 0 { /* In this case we would like to delete the journal file. If it is ** not possible, then that is not a problem. Deleting the journal file ** here is an optimization only. @@ -40216,7 +40235,7 @@ func _pagerExclusiveLock(tls *libc.TLS, pPager uintptr) (r int32) { if rc != SQLITE_OK { /* If the attempt to grab the exclusive lock failed, release the ** pending lock that may have been obtained instead. */ - _pagerUnlockDb(tls, pPager, int32(eOrigLock)) + _pagerUnlockDb(tls, pPager, int32(int32(eOrigLock))) } return rc } @@ -41068,7 +41087,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { nByte = int64(uint64(8) * uint64(iPage+libc.Int32FromInt32(1))) - apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte)) + apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, uint64(uint64(nByte))) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) return int32(SQLITE_NOMEM) @@ -41079,7 +41098,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if int32((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -41504,7 +41523,7 @@ func _walFramePgno(tls *libc.TLS, pWal uintptr, iFrame Tu32) (r Tu32) { _ = iHash iHash = _walFramePage(tls, iFrame) if iHash == 0 { - return *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((libc.Uint64FromInt64(48)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(40))/libc.Uint64FromInt64(4)+uint64(iFrame)-uint64(1))*4)) + return *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((libc.Uint64FromInt64(48)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(40))/libc.Uint64FromInt64(4)+uint64(uint64(iFrame))-uint64(1))*4)) } return *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((uint64(iFrame-uint32(1))-(libc.Uint64FromInt32(HASHTABLE_NPAGE)-(libc.Uint64FromInt64(48)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(40))/libc.Uint64FromInt64(4)))%uint64(HASHTABLE_NPAGE))*4)) } @@ -41562,7 +41581,7 @@ func _walCleanupHash(tls *libc.TLS, pWal uintptr) { ** frame numbers greater than pWal->hdr.mxFrame. */ nByte = int32(int64((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash) - int64((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4)) - libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4, 0, uint64(nByte)) + libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno+uintptr(iLimit)*4, 0, uint64(uint64(nByte))) } // C documentation @@ -41588,7 +41607,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in */ if idx == int32(1) { nByte = int32(int64((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))*2) - int64((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno)) - libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno, 0, uint64(nByte)) + libc.Xmemset(tls, (*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno, 0, uint64(uint64(nByte))) } /* If the entry in aPgno[] is already set, then the previous writer ** must have exited unexpectedly in the middle of a transaction (after @@ -41617,7 +41636,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in iKey = _walNextHash(tls, iKey) } *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaPgno + uintptr(idx-int32(1))*4)) = iPage - libc.AtomicStoreNUint16((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(iKey)*2, uint16(idx), libc.Int32FromInt32(__ATOMIC_RELAXED)) + libc.AtomicStoreNUint16((*(*TWalHashLoc)(unsafe.Pointer(bp))).FaHash+uintptr(iKey)*2, uint16(uint16(idx)), libc.Int32FromInt32(__ATOMIC_RELAXED)) } return rc } @@ -41685,7 +41704,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { goto finished } (*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = uint8(magic & libc.Uint32FromInt32(0x00000001)) - (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(szPage) + (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(uint32(szPage)) (*TWal)(unsafe.Pointer(pWal)).FnCkpt = _sqlite3Get4byte(tls, bp+8+12) libc.Xmemcpy(tls, pWal+72+32, bp+8+16, uint64(8)) /* Verify that the WAL header checksum is correct */ @@ -41702,7 +41721,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, uint64(szFrame)+(libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(uint64(uint64(szFrame))+(libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -41710,7 +41729,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { aData = aFrame + 24 aPrivate = aData + uintptr(szPage) /* Read all frames from the log file. */ - iLastFrame = uint32((*(*Ti64)(unsafe.Pointer(bp)) - int64(WAL_HDRSIZE)) / int64(szFrame)) + iLastFrame = uint32((*(*Ti64)(unsafe.Pointer(bp)) - int64(WAL_HDRSIZE)) / int64(int64(szFrame))) iPg = uint32(0) for { if !(iPg <= uint32(_walFramePage(tls, iLastFrame))) { @@ -41728,7 +41747,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { v3 = libc.Uint64FromInt32(HASHTABLE_NPAGE) - (libc.Uint64FromInt64(48)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(40))/libc.Uint64FromInt64(4) + uint64((iPg-uint32(1))*uint32(HASHTABLE_NPAGE)) } iFirst = uint32(uint64(1) + v3) - rc = _walIndexPage(tls, pWal, int32(iPg), bp+40) + rc = _walIndexPage(tls, pWal, int32(int32(iPg)), bp+40) if *(*uintptr)(unsafe.Pointer(bp + 40)) == uintptr(0) { break } @@ -41772,7 +41791,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { v5 = uint64(0) } nHdr = uint32(v5) - nHdr32 = uint32(uint64(nHdr) / uint64(4)) + nHdr32 = uint32(uint64(uint64(nHdr)) / uint64(4)) /* Memcpy() should work fine here, on all reasonable implementations. ** Technically, memcpy() might change the destination to some ** intermediate value before setting to the final value, and that might @@ -41781,7 +41800,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** we know of actually does that, which is why we say that memcpy() ** is safe for this. Memcpy() is certainly a lot faster. */ - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 40))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)-uint64(nHdr)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 40))+uintptr(nHdr32)*4, aPrivate+uintptr(nHdr32)*4, libc.Uint64FromInt64(2)*uint64(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)-uint64(uint64(nHdr))) if iFrame <= iLast { break } @@ -41792,6 +41811,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -41838,6 +41858,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { v1 = iLast } - p = Xsqlite3_malloc64(tls, uint64(nByte)+uint64(2)*uint64(v1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(nByte))+uint64(uint64(2)*uint64(v1))) if !(p != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, p, 0, uint64(nByte)) + libc.Xmemset(tls, p, 0, uint64(uint64(nByte))) (*TWalIterator)(unsafe.Pointer(p)).FnSegment = nSegment aTmp = p + uintptr(nByte) i = _walFramePage(tls, nBackfill+uint32(1)) @@ -42242,7 +42263,7 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( if !(j < *(*int32)(unsafe.Pointer(bp + 24))) { break } - *(*Tht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = uint16(j) + *(*Tht_slot)(unsafe.Pointer(aIndex + uintptr(j)*2)) = uint16(uint16(j)) goto _3 _3: ; @@ -42456,11 +42477,11 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** about the eventual size of the db file to the VFS layer. */ if rc == SQLITE_OK { - *(*Ti64)(unsafe.Pointer(bp + 16)) = int64(mxPage) * int64(szPage) /* Current size of database file */ + *(*Ti64)(unsafe.Pointer(bp + 16)) = int64(int64(mxPage)) * int64(int64(szPage)) /* Current size of database file */ _sqlite3OsFileControl(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_CKPT_START), uintptr(0)) rc = _sqlite3OsFileSize(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, bp+24) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 24)) < *(*Ti64)(unsafe.Pointer(bp + 16)) { - if *(*Ti64)(unsafe.Pointer(bp + 24))+int64(65536)+int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*int64(szPage) < *(*Ti64)(unsafe.Pointer(bp + 16)) { + if *(*Ti64)(unsafe.Pointer(bp + 24))+int64(65536)+int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)*int64(int64(szPage)) < *(*Ti64)(unsafe.Pointer(bp + 16)) { /* If the size of the final database is larger than the current ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then @@ -42491,7 +42512,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy if rc != SQLITE_OK { break } - iOffset = int64(*(*Tu32)(unsafe.Pointer(bp + 8))-libc.Uint32FromInt32(1)) * int64(szPage) + iOffset = int64(*(*Tu32)(unsafe.Pointer(bp + 8))-libc.Uint32FromInt32(1)) * int64(int64(szPage)) rc = _sqlite3OsWrite(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, zBuf, szPage, iOffset) if rc != SQLITE_OK { break @@ -42501,7 +42522,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy /* If work was actually accomplished... */ if rc == SQLITE_OK { if mxSafeFrame == (*TWalIndexHdr)(unsafe.Pointer(_walIndexHdr(tls, pWal))).FmxFrame { - szDb = int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * int64(szPage) + szDb = int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * int64(int64(szPage)) rc = _sqlite3OsTruncate(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, szDb) if rc == SQLITE_OK { rc = _sqlite3OsSync(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, sync_flags>>int32(2)&int32(0x03)) @@ -42555,6 +42576,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } } } + goto walcheckpoint_out walcheckpoint_out: ; _walIteratorFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -42968,7 +42990,7 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in } /* Allocate a buffer to read frames into */ szFrame = int32((*TWal)(unsafe.Pointer(pWal)).FszPage + uint32(WAL_FRAME_HDRSIZE)) - aFrame = Xsqlite3_malloc64(tls, uint64(szFrame)) + aFrame = Xsqlite3_malloc64(tls, uint64(uint64(szFrame))) if aFrame == uintptr(0) { rc = int32(SQLITE_NOMEM) goto begin_unreliable_shm_out @@ -42982,7 +43004,7 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in aSaveCksum[int32(1)] = *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) iOffset = libc.Int64FromInt32(WAL_HDRSIZE) + int64((*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64((*TWal)(unsafe.Pointer(pWal)).FszPage+libc.Uint32FromInt32(WAL_FRAME_HDRSIZE)) for { - if !(iOffset+int64(szFrame) <= *(*Ti64)(unsafe.Pointer(bp))) { + if !(iOffset+int64(int64(szFrame)) <= *(*Ti64)(unsafe.Pointer(bp))) { break } /* dbsize field from frame header */ /* Read and decode the next log frame. */ @@ -43003,10 +43025,11 @@ func _walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r in goto _3 _3: ; - iOffset += int64(szFrame) + iOffset += int64(int64(szFrame)) } *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = aSaveCksum[0] *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = aSaveCksum[int32(1)] + goto begin_unreliable_shm_out begin_unreliable_shm_out: ; Xsqlite3_free(tls, aFrame) @@ -43328,7 +43351,7 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 _walUnlockShared(tls, pWal, int32(3)+mxI) return -int32(1) } else { - (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(mxI) + (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(int16(mxI)) } return rc } @@ -43363,14 +43386,14 @@ func _walSnapshotRecover(tls *libc.TLS, pWal uintptr, pBuf1 uintptr, pBuf2 uintp break } pgno = *(*Tu32)(unsafe.Pointer((*(*TWalHashLoc)(unsafe.Pointer(bp + 8))).FaPgno + uintptr(i-(*(*TWalHashLoc)(unsafe.Pointer(bp + 8))).FiZero-uint32(1))*4)) - iDbOff = int64(pgno-libc.Uint32FromInt32(1)) * int64(szPage) - if iDbOff+int64(szPage) <= *(*Ti64)(unsafe.Pointer(bp)) { + iDbOff = int64(pgno-libc.Uint32FromInt32(1)) * int64(int64(szPage)) + if iDbOff+int64(int64(szPage)) <= *(*Ti64)(unsafe.Pointer(bp)) { iWalOff = int64(WAL_HDRSIZE) + int64(i-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE) rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { rc = _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, pBuf2, szPage, iDbOff) } - if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint64(szPage)) { + if rc != SQLITE_OK || 0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint64(uint64(szPage))) { break } } @@ -43948,13 +43971,13 @@ type WalWriter = TWalWriter func _walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Tsqlite3_int64) (r int32) { var iFirstAmt, rc int32 _, _ = iFirstAmt, rc - if iOffset < (*TWalWriter)(unsafe.Pointer(p)).FiSyncPoint && iOffset+int64(iAmt) >= (*TWalWriter)(unsafe.Pointer(p)).FiSyncPoint { + if iOffset < (*TWalWriter)(unsafe.Pointer(p)).FiSyncPoint && iOffset+int64(int64(iAmt)) >= (*TWalWriter)(unsafe.Pointer(p)).FiSyncPoint { iFirstAmt = int32((*TWalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset) rc = _sqlite3OsWrite(tls, (*TWalWriter)(unsafe.Pointer(p)).FpFd, pContent, iFirstAmt, iOffset) if rc != 0 { return rc } - iOffset += int64(iFirstAmt) + iOffset += int64(int64(iFirstAmt)) iAmt -= iFirstAmt pContent = uintptr(iFirstAmt) + pContent rc = _sqlite3OsSync(tls, (*TWalWriter)(unsafe.Pointer(p)).FpFd, (*TWalWriter)(unsafe.Pointer(p)).FsyncFlags&int32(0x03)) @@ -43979,13 +44002,13 @@ func _walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, var _ /* aFrame at bp+0 */ [24]Tu8 _, _ = pData, rc /* Buffer to assemble frame-header in */ pData = (*TPgHdr)(unsafe.Pointer(pPage)).FpData - _walEncodeFrame(tls, (*TWalWriter)(unsafe.Pointer(p)).FpWal, (*TPgHdr)(unsafe.Pointer(pPage)).Fpgno, uint32(nTruncate), pData, bp) + _walEncodeFrame(tls, (*TWalWriter)(unsafe.Pointer(p)).FpWal, (*TPgHdr)(unsafe.Pointer(pPage)).Fpgno, uint32(uint32(nTruncate)), pData, bp) rc = _walWriteToLog(tls, p, bp, int32(24), iOffset) if rc != 0 { return rc } /* Write the page data */ - rc = _walWriteToLog(tls, p, pData, (*TWalWriter)(unsafe.Pointer(p)).FszPage, int64(uint64(iOffset)+uint64(24))) + rc = _walWriteToLog(tls, p, pData, (*TWalWriter)(unsafe.Pointer(p)).FszPage, int64(uint64(uint64(iOffset))+uint64(24))) return rc } @@ -44094,7 +44117,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc if iFrame == uint32(0) { /* Checksum for wal-header */ _sqlite3Put4byte(tls, bp+32, uint32(libc.Int32FromInt32(WAL_MAGIC)|libc.Int32FromInt32(SQLITE_BIGENDIAN))) _sqlite3Put4byte(tls, bp+32+4, uint32(WAL_MAX_VERSION)) - _sqlite3Put4byte(tls, bp+32+8, uint32(szPage)) + _sqlite3Put4byte(tls, bp+32+8, uint32(uint32(szPage))) _sqlite3Put4byte(tls, bp+32+12, (*TWal)(unsafe.Pointer(pWal)).FnCkpt) if (*TWal)(unsafe.Pointer(pWal)).FnCkpt == uint32(0) { Xsqlite3_randomness(tls, int32(8), pWal+72+32) @@ -44103,7 +44126,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc _walChecksumBytes(tls, int32(1), bp+32, libc.Int32FromInt32(WAL_HDRSIZE)-libc.Int32FromInt32(2)*libc.Int32FromInt32(4), uintptr(0), bp+64) _sqlite3Put4byte(tls, bp+32+24, (*(*[2]Tu32)(unsafe.Pointer(bp + 64)))[0]) _sqlite3Put4byte(tls, bp+32+28, (*(*[2]Tu32)(unsafe.Pointer(bp + 64)))[int32(1)]) - (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(szPage) + (*TWal)(unsafe.Pointer(pWal)).FszPage = uint32(uint32(szPage)) (*TWal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = uint8(SQLITE_BIGENDIAN) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = (*(*[2]Tu32)(unsafe.Pointer(bp + 64)))[0] *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = (*(*[2]Tu32)(unsafe.Pointer(bp + 64)))[int32(1)] @@ -44177,7 +44200,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc return rc } pLast = p - iOffset += int64(szFrame) + iOffset += int64(int64(szFrame)) p5 = p + 52 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(PGHDR_WAL_APPEND)) goto _2 @@ -44210,14 +44233,14 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc bSync = int32(1) if (*TWal)(unsafe.Pointer(pWal)).FpadToSectorBoundary != 0 { sectorSize = _sqlite3SectorSize(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd) - (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint = (iOffset + int64(sectorSize) - int64(1)) / int64(sectorSize) * int64(sectorSize) + (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint = (iOffset + int64(int64(sectorSize)) - int64(1)) / int64(int64(sectorSize)) * int64(int64(sectorSize)) bSync = libc.BoolInt32((*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint == iOffset) for iOffset < (*(*TWalWriter)(unsafe.Pointer(bp))).FiSyncPoint { - rc = _walWriteOneFrame(tls, bp, pLast, int32(nTruncate), iOffset) + rc = _walWriteOneFrame(tls, bp, pLast, int32(int32(nTruncate)), iOffset) if rc != 0 { return rc } - iOffset += int64(szFrame) + iOffset += int64(int64(szFrame)) nExtra++ } } @@ -44231,8 +44254,8 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc */ if isCommit != 0 && (*TWal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0 && (*TWal)(unsafe.Pointer(pWal)).FmxWalSize >= 0 { sz = (*TWal)(unsafe.Pointer(pWal)).FmxWalSize - if int64(WAL_HDRSIZE)+int64(iFrame+uint32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) > (*TWal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iFrame+uint32(nExtra)+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + if int64(WAL_HDRSIZE)+int64(iFrame+uint32(uint32(nExtra))+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) > (*TWal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = libc.Int64FromInt32(WAL_HDRSIZE) + int64(iFrame+uint32(uint32(nExtra))+libc.Uint32FromInt32(1)-libc.Uint32FromInt32(1))*int64(szPage+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) } _walLimitSize(tls, pWal, sz) (*TWal)(unsafe.Pointer(pWal)).FtruncateOnCommit = uint8(0) @@ -44428,7 +44451,7 @@ func _sqlite3WalCallback(tls *libc.TLS, pWal uintptr) (r int32) { ret = (*TWal)(unsafe.Pointer(pWal)).FiCallback (*TWal)(unsafe.Pointer(pWal)).FiCallback = uint32(0) } - return int32(ret) + return int32(int32(ret)) } // C documentation @@ -45518,7 +45541,7 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(uint8(skipOk)) } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -45700,9 +45723,9 @@ func _querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab TPgno, eLock Tu8) ** may hold a WRITE_LOCK on any table in this file (since there can ** only be a single writer). */ - if (*TBtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*TBtLock)(unsafe.Pointer(pIter)).FiTable == iTab && int32((*TBtLock)(unsafe.Pointer(pIter)).FeLock) != int32(eLock) { + if (*TBtLock)(unsafe.Pointer(pIter)).FpBtree != p && (*TBtLock)(unsafe.Pointer(pIter)).FiTable == iTab && int32((*TBtLock)(unsafe.Pointer(pIter)).FeLock) != int32(int32(eLock)) { _sqlite3ConnectionBlocked(tls, (*TBtree)(unsafe.Pointer(p)).Fdb, (*TBtree)(unsafe.Pointer((*TBtLock)(unsafe.Pointer(pIter)).FpBtree)).Fdb) - if int32(eLock) == int32(WRITE_LOCK) { + if int32(int32(eLock)) == int32(WRITE_LOCK) { p2 = pBt + 40 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_PENDING)) } @@ -45778,7 +45801,7 @@ func _setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable TPgno, eLock Tu8) ** and the requested lock. This means if a write-lock was already held ** and a read-lock requested, we don't incorrectly downgrade the lock. */ - if int32(eLock) > int32((*TBtLock)(unsafe.Pointer(pLock)).FeLock) { + if int32(int32(eLock)) > int32((*TBtLock)(unsafe.Pointer(pLock)).FeLock) { (*TBtLock)(unsafe.Pointer(pLock)).FeLock = eLock } return SQLITE_OK @@ -46211,7 +46234,7 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int if pIdxKey == uintptr(0) { return int32(SQLITE_NOMEM) } - _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) + _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(int32(nKey)), pKey, pIdxKey) if int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { rc = _sqlite3CorruptError(tls, int32(71032)) } else { @@ -46336,7 +46359,7 @@ func _sqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp // ** Provide flag hints to the cursor. // */ func _sqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { - (*TBtCursor)(unsafe.Pointer(pCur)).Fhints = uint8(x) + (*TBtCursor)(unsafe.Pointer(pCur)).Fhints = uint8(uint8(x)) } // C documentation @@ -46358,9 +46381,9 @@ func _ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno TPgno) (r TPgno) { return uint32(0) } nPagesPerMapPage = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(5) + uint32(1)) - iPtrMap = (pgno - uint32(2)) / uint32(nPagesPerMapPage) - ret = iPtrMap*uint32(nPagesPerMapPage) + uint32(2) - if ret == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + iPtrMap = (pgno - uint32(2)) / uint32(uint32(nPagesPerMapPage)) + ret = iPtrMap*uint32(uint32(nPagesPerMapPage)) + uint32(2) + if ret == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { ret++ } return ret @@ -46413,7 +46436,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - if int32(eType) != int32(*(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || _sqlite3Get4byte(tls, pPtrmap+uintptr(offset+int32(1))) != parent { + if int32(int32(eType)) != int32(*(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset)))) || _sqlite3Get4byte(tls, pPtrmap+uintptr(offset+int32(1))) != parent { v1 = _sqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = v1 *(*int32)(unsafe.Pointer(pRC)) = v1 @@ -46422,6 +46445,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, _sqlite3Put4byte(tls, pPtrmap+uintptr(offset+int32(1)), parent) } } + goto ptrmap_exit ptrmap_exit: ; _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46444,12 +46468,12 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin var _ /* pDbPage at bp+0 */ uintptr _, _, _, _ = iPtrmap, offset, pPtrmap, rc iPtrmap = int32(_ptrmapPageno(tls, pBt, key)) - rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, uint32(iPtrmap), bp, 0) + rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, uint32(uint32(iPtrmap)), bp, 0) if rc != 0 { return rc } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - offset = int32(libc.Uint32FromInt32(5) * (key - uint32(iPtrmap) - libc.Uint32FromInt32(1))) + offset = int32(libc.Uint32FromInt32(5) * (key - uint32(uint32(iPtrmap)) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) return _sqlite3CorruptError(tls, int32(71293)) @@ -46489,13 +46513,13 @@ func _btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell ui _, _, _ = maxLocal, minLocal, surplus /* Overflow payload available for local storage */ minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) maxLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) - surplus = int32(uint32(minLocal) + ((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) + surplus = int32(uint32(uint32(minLocal)) + ((*TCellInfo)(unsafe.Pointer(pInfo)).FnPayload-uint32(uint32(minLocal)))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) if surplus <= maxLocal { - (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(surplus) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(uint16(surplus)) } else { - (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(minLocal) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal = uint16(uint16(minLocal)) } - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(t__predefined_ptrdiff_t((*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int64(pCell))) + int32(4)) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(t__predefined_ptrdiff_t((*TCellInfo)(unsafe.Pointer(pInfo)).FpPayload+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnLocal))-int64(int64(pCell)))) + int32(4)) } // C documentation @@ -46508,11 +46532,11 @@ func _btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload Ti64) (r int32) var maxLocal, minLocal, surplus, v1 int32 _, _, _, _ = maxLocal, minLocal, surplus, v1 /* Maximum amount of payload held locally */ maxLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) - if nPayload <= int64(maxLocal) { - return int32(nPayload) + if nPayload <= int64(int64(maxLocal)) { + return int32(int32(nPayload)) } else { /* Overflow payload available for local storage */ minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - surplus = int32(int64(minLocal) + (nPayload-int64(minLocal))%int64((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-libc.Uint32FromInt32(4))) + surplus = int32(int64(int64(minLocal)) + (nPayload-int64(int64(minLocal)))%int64((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-libc.Uint32FromInt32(4))) if surplus <= maxLocal { v1 = surplus } else { @@ -46588,43 +46612,43 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp v2 = *(*Tu8)(unsafe.Pointer(v3)) x = v2 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v5 = pIter v4 = *(*Tu8)(unsafe.Pointer(v5)) x = v4 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v7 = pIter v6 = *(*Tu8)(unsafe.Pointer(v7)) x = v6 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v9 = pIter v8 = *(*Tu8)(unsafe.Pointer(v9)) x = v8 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v11 = pIter v10 = *(*Tu8)(unsafe.Pointer(v11)) x = v10 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v13 = pIter v12 = *(*Tu8)(unsafe.Pointer(v13)) x = v12 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v15 = pIter v14 = *(*Tu8)(unsafe.Pointer(v15)) x = v14 *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))<= int32(0x80) { + if int32(int32(x)) >= int32(0x80) { pIter++ v16 = pIter *(*Tu64)(unsafe.Pointer(bp)) = *(*Tu64)(unsafe.Pointer(bp))< uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = uint32(uint32(minLocal)) } - nSize += uint32(int32(4) + int32(uint16(int64(pIter)-int64(pCell)))) + nSize += uint32(int32(4) + int32(uint16(int64(int64(pIter))-int64(int64(pCell))))) } - return uint16(nSize) + return uint16(uint16(nSize)) } func _cellSizePtrIdxLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { @@ -46759,19 +46783,19 @@ func _cellSizePtrIdxLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { } pIter++ if nSize <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize += uint32(int64(pIter) - int64(pCell)) + nSize += uint32(int64(int64(pIter)) - int64(int64(pCell))) if nSize < uint32(4) { nSize = uint32(4) } } else { minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - nSize = uint32(minLocal) + (nSize-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) + nSize = uint32(uint32(minLocal)) + (nSize-uint32(uint32(minLocal)))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) if nSize > uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = uint32(uint32(minLocal)) } - nSize += uint32(int32(4) + int32(uint16(int64(pIter)-int64(pCell)))) + nSize += uint32(int32(4) + int32(uint16(int64(int64(pIter))-int64(int64(pCell))))) } - return uint16(nSize) + return uint16(uint16(nSize)) } func _cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { @@ -46787,7 +46811,7 @@ func _cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) break } } - return uint16(int64(pIter) - int64(pCell)) + return uint16(int64(int64(pIter)) - int64(int64(pCell))) } func _cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) { @@ -46845,19 +46869,19 @@ func _cellSizePtrTableLeaf(tls *libc.TLS, pPage uintptr, pCell uintptr) (r Tu16) pIter++ } if nSize <= uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize += uint32(int64(pIter) - int64(pCell)) + nSize += uint32(int64(int64(pIter)) - int64(int64(pCell))) if nSize < uint32(4) { nSize = uint32(4) } } else { minLocal = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - nSize = uint32(minLocal) + (nSize-uint32(minLocal))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) + nSize = uint32(uint32(minLocal)) + (nSize-uint32(uint32(minLocal)))%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4)) if nSize > uint32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { - nSize = uint32(minLocal) + nSize = uint32(uint32(minLocal)) } - nSize += uint32(int32(4) + int32(uint16(int64(pIter)-int64(pCell)))) + nSize += uint32(int32(4) + int32(uint16(int64(int64(pIter))-int64(int64(pCell))))) } - return uint16(nSize) + return uint16(uint16(nSize)) } // C documentation @@ -46981,7 +47005,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { iCellStart = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))< 0 { temp = _sqlite3PagerTempSpace(tls, (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FpPager) - libc.Xmemcpy(tls, temp, data, uint64(usableSize)) + libc.Xmemcpy(tls, temp, data, uint64(uint64(usableSize))) src = temp i = 0 for { @@ -47003,7 +47027,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { } *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) - libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), uint64(size)) + libc.Xmemcpy(tls, data+uintptr(cbrk), src+uintptr(pc), uint64(uint64(size))) goto _2 _2: ; @@ -47011,6 +47035,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { } } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + goto defragment_out defragment_out: ; if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { @@ -47044,12 +47069,12 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint var aData, pTmp, p2 uintptr var hdr, iAddr, maxPC, pc, size, x, v1 int32 _, _, _, _, _, _, _, _, _, _ = aData, hdr, iAddr, maxPC, pTmp, pc, size, x, v1, p2 - hdr = int32((*TMemPage)(unsafe.Pointer(pPg)).FhdrOffset) /* Offset to page header */ - aData = (*TMemPage)(unsafe.Pointer(pPg)).FaData /* Page data */ - iAddr = hdr + int32(1) /* Address of ptr to pc */ - pTmp = aData + uintptr(iAddr) /* Temporary ptr into aData[] */ - pc = int32(*(*Tu8)(unsafe.Pointer(pTmp)))< maxPC { @@ -47155,7 +47180,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if (*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(2)))) != 0 || *(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))) != 0) && gap+int32(2) <= top { pSpace = _pageFindSlot(tls, pPage, nByte, bp) if pSpace != 0 { - v1 = int32(int64(pSpace) - int64(data)) + v1 = int32(int64(int64(pSpace)) - int64(int64(data))) g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { @@ -47221,32 +47246,32 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ nFrag = uint8(0) /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = uint32(int32(iStart) + int32(iSize)) /* First byte past the iStart buffer */ + iEnd = uint32(int32(int32(iStart)) + int32(int32(iSize))) /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = uint16(int32(hdr) + int32(1)) - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iPtr = uint16(int32(int32(hdr)) + int32(1)) + if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(iPtr))+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ } else { for { v1 = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ + if uint32(uint32(iFreeBlk)) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ return _sqlite3CorruptError(tls, int32(72103)) } /* At this point: @@ -47255,70 +47280,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { + if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(uint32(iFreeBlk)) { + nFrag = uint8(uint32(uint32(iFreeBlk)) - iEnd) + if iEnd > uint32(uint32(iFreeBlk)) { return _sqlite3CorruptError(tls, int32(72115)) } - iEnd = uint32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { return _sqlite3CorruptError(tls, int32(72118)) } - iSize = uint16(iEnd - uint32(iStart)) + iSize = uint16(iEnd - uint32(uint32(iStart))) iFreeBlk = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< int32(hdr)+int32(1) { - iPtrEnd = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(2)))))<= int32(iStart) { - if iPtrEnd > int32(iStart) { + if int32(int32(iPtr)) > int32(int32(hdr))+int32(1) { + iPtrEnd = int32(int32(iPtr)) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(iPtr))+int32(2)))))<= int32(int32(iStart)) { + if iPtrEnd > int32(int32(iStart)) { return _sqlite3CorruptError(tls, int32(72131)) } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag = Tu8(int32(nFrag) + (int32(int32(iStart)) - iPtrEnd)) + iSize = uint16(iEnd - uint32(uint32(iPtr))) iStart = iPtr } } - if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { + if int32(int32(nFrag)) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(7))))) { return _sqlite3CorruptError(tls, int32(72137)) } - p2 = data + uintptr(int32(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(nFrag)) + p2 = data + uintptr(int32(int32(hdr))+int32(7)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(int32(nFrag))) } - pTmp = data + uintptr(int32(hdr)+int32(5)) + pTmp = data + uintptr(int32(int32(hdr))+int32(5)) x = uint16(int32(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(1)))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(1)) + 1)) = uint8(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(5)) + 1)) = uint8(iEnd) } else { /* Insert the new freeblock into the freelist */ *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(int32(iStart) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)))) = uint8(int32(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)) + 1)) = uint8(iSize) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(iStart))+int32(2)))) = uint8(int32(iSize) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(iStart))+int32(2)) + 1)) = uint8(iSize) } - *(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += int32(int32(iOrigSize)) return SQLITE_OK } @@ -47415,15 +47440,15 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-58015-48175 The two-byte integer at offset 5 designates ** the start of the cell content area. A zero value for this integer is ** interpreted as 65536. */ - top = (int32(*(*Tu8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))))< 0 { if pc < top { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will @@ -47438,17 +47463,17 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { } next = uint32(int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ return _sqlite3CorruptError(tls, int32(72296)) } - if uint32(pc)+size > uint32(usableSize) { + if uint32(uint32(pc))+size > uint32(uint32(usableSize)) { /* Last freeblock extends past page end */ return _sqlite3CorruptError(tls, int32(72300)) } @@ -47568,20 +47593,20 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(uint32(hdr)))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(int8(flags)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(int8(int8(flags))) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = uint16(int32(hdr) + v1) - libc.Xmemset(tls, data+uintptr(int32(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = uint16(int32(int32(hdr)) + v1) + libc.Xmemset(tls, data+uintptr(int32(int32(hdr))+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(int32(hdr))+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(uint32(first)))) _decodeFlags(tls, pPage, flags) (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) @@ -47879,7 +47904,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt return int32(SQLITE_NOMEM) } if isMemdb != 0 { - libc.Xmemcpy(tls, zFullPathname, zFilename, uint64(nFilename)) + libc.Xmemcpy(tls, zFullPathname, zFilename, uint64(uint64(nFilename))) } else { rc = _sqlite3OsFullPathname(tls, pVfs, zFilename, nFullPathname, zFullPathname) if rc != 0 { @@ -47954,7 +47979,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt if rc != SQLITE_OK { goto btree_open_out } - (*TBtShared)(unsafe.Pointer(pBt)).FopenFlags = uint8(flags) + (*TBtShared)(unsafe.Pointer(pBt)).FopenFlags = uint8(uint8(flags)) (*TBtShared)(unsafe.Pointer(pBt)).Fdb = db _sqlite3PagerSetBusyHandler(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, __ccgo_fp(_btreeInvokeBusyHandler), pBt) (*TBtree)(unsafe.Pointer(p)).FpBt = pBt @@ -48001,11 +48026,11 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt } (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(v7) } - rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52, int32(nReserve)) + rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52, int32(int32(nReserve))) if rc != 0 { goto btree_open_out } - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(nReserve) + (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(uint32(nReserve)) /* 8-byte alignment of pageSize */ /* Add the new BtShared object to the linked list sharable BtShareds. */ @@ -48065,6 +48090,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt } } *(*uintptr)(unsafe.Pointer(ppBtree)) = p + goto btree_open_out btree_open_out: ; if rc != SQLITE_OK { @@ -48335,7 +48361,7 @@ func _sqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve rc = SQLITE_OK pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - (*TBtShared)(unsafe.Pointer(pBt)).FnReserveWanted = uint8(nReserve) + (*TBtShared)(unsafe.Pointer(pBt)).FnReserveWanted = uint8(uint8(nReserve)) x = int32((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize) if nReserve < x { nReserve = x @@ -48348,11 +48374,11 @@ func _sqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve if nReserve > int32(32) && pageSize == int32(512) { pageSize = int32(1024) } - (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = uint32(pageSize) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize = uint32(uint32(pageSize)) _freeTempSpace(tls, pBt) } rc = _sqlite3PagerSetPagesize(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pBt+52, nReserve) - (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(uint16(nReserve)) + (*TBtShared)(unsafe.Pointer(pBt)).FusableSize = (*TBtShared)(unsafe.Pointer(pBt)).FpageSize - uint32(uint16(uint16(nReserve))) if iFix != 0 { p1 = pBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTS_PAGESIZE_FIXED)) @@ -48487,7 +48513,7 @@ func _sqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) (r i _, _, _, _, _, _, _ = av, pBt, rc, v1, v2, v3, v4 pBt = (*TBtree)(unsafe.Pointer(p)).FpBt rc = SQLITE_OK - av = uint8(autoVacuum) + av = uint8(uint8(autoVacuum)) _sqlite3BtreeEnter(tls, p) if v2 = int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_PAGESIZE_FIXED) != 0; v2 { if av != 0 { @@ -48505,7 +48531,7 @@ func _sqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) (r i v3 = 0 } (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum = uint8(v3) - if int32(av) == int32(2) { + if int32(int32(av)) == int32(2) { v4 = int32(1) } else { v4 = 0 @@ -48718,6 +48744,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 = *(*uintptr)(unsafe.Pointer(bp)) (*TBtShared)(unsafe.Pointer(pBt)).FnPage = nPage return SQLITE_OK + goto page1_init_failed page1_init_failed: ; _releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -48987,6 +49014,7 @@ func _btreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uin } } } + goto trans_begun trans_begun: ; if rc == SQLITE_OK { @@ -49100,7 +49128,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT var pCell uintptr var _ /* info at bp+0 */ TCellInfo _, _, _, _, _ = i, nCell, pCell, rc, v1 - if int32(eType) == int32(PTRMAP_OVERFLOW2) { + if int32(int32(eType)) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { return _sqlite3CorruptError(tls, int32(73995)) @@ -49123,7 +49151,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT break } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*i)))))) - if int32(eType) == int32(PTRMAP_OVERFLOW1) { + if int32(int32(eType)) == int32(PTRMAP_OVERFLOW1) { (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { @@ -49149,7 +49177,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT i++ } if i == nCell { - if int32(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { + if int32(int32(eType)) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { return _sqlite3CorruptError(tls, int32(74035)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) @@ -49196,7 +49224,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP ** pointer to a subsequent overflow page. If this is the case, then ** the pointer map needs to be updated for the subsequent overflow page. */ - if int32(eType) == int32(PTRMAP_BTREE) || int32(eType) == int32(PTRMAP_ROOTPAGE) { + if int32(int32(eType)) == int32(PTRMAP_BTREE) || int32(int32(eType)) == int32(PTRMAP_ROOTPAGE) { *(*int32)(unsafe.Pointer(bp + 8)) = _setChildPtrmaps(tls, pDbPage) if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 8)) @@ -49214,7 +49242,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP ** that it points at iFreePage. Also fix the pointer map entry for ** iPtrPage. */ - if int32(eType) != int32(PTRMAP_ROOTPAGE) { + if int32(int32(eType)) != int32(PTRMAP_ROOTPAGE) { *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iPtrPage, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 8)) @@ -49266,7 +49294,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom var _ /* pFreePg at bp+40 */ uintptr var _ /* pLastPg at bp+32 */ uintptr _, _, _, _, _ = dbSize, eMode, iNear, nFreeList, rc - if !(_ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if !(_ptrmapPageno(tls, pBt, iLastPg) == iLastPg) && iLastPg != uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFreeList = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) if nFreeList == uint32(0) { return int32(SQLITE_DONE) @@ -49325,7 +49353,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom } } if bCommit == 0 { - for cond := true; cond; cond = iLastPg == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, iLastPg) == iLastPg { + for cond := true; cond; cond = iLastPg == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, iLastPg) == iLastPg { iLastPg-- } (*TBtShared)(unsafe.Pointer(pBt)).FbDoTruncate = uint8(1) @@ -49346,12 +49374,12 @@ func _finalDbSize(tls *libc.TLS, pBt uintptr, nOrig TPgno, nFree TPgno) (r TPgno var nFin, nPtrmap TPgno _, _, _ = nEntry, nFin, nPtrmap /* Return value */ nEntry = int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize / uint32(5)) - nPtrmap = (nFree - nOrig + _ptrmapPageno(tls, pBt, nOrig) + uint32(nEntry)) / uint32(nEntry) + nPtrmap = (nFree - nOrig + _ptrmapPageno(tls, pBt, nOrig) + uint32(uint32(nEntry))) / uint32(uint32(nEntry)) nFin = nOrig - nFree - nPtrmap - if nOrig > uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) && nFin < uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if nOrig > uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) && nFin < uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFin-- } - for _ptrmapPageno(tls, pBt, nFin) == nFin || nFin == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for _ptrmapPageno(tls, pBt, nFin) == nFin || nFin == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { nFin-- } return nFin @@ -49419,7 +49447,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { _invalidateAllOverflowCache(tls, pBt) if !((*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum != 0) { /* Database size before freeing */ nOrig = _btreePagecount(tls, pBt) - if _ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if _ptrmapPageno(tls, pBt, nOrig) == nOrig || nOrig == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { /* It is not possible to create a database for which the final page ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. @@ -50120,7 +50148,7 @@ func _sqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { // */ func _sqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) (r Ti64) { _getCellInfo(tls, pCur) - return int64((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + (int64((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) - int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) + return int64((*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize)*(int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno)-int64(1)) + int64(int64((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload)-int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) } // C documentation @@ -50199,7 +50227,7 @@ func _getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl TPgno, ppPage uintptr, pP */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { iGuess = ovfl + uint32(1) - for _ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for _ptrmapPageno(tls, pBt, iGuess) == iGuess || iGuess == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { iGuess++ } if iGuess <= _btreePagecount(tls, pBt) { @@ -50257,10 +50285,10 @@ func _copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eO if rc != SQLITE_OK { return rc } - libc.Xmemcpy(tls, pPayload, pBuf, uint64(nByte)) + libc.Xmemcpy(tls, pPayload, pBuf, uint64(uint64(nByte))) } else { /* Copy data from page to buffer (a read operation) */ - libc.Xmemcpy(tls, pBuf, pPayload, uint64(nByte)) + libc.Xmemcpy(tls, pBuf, pPayload, uint64(uint64(nByte))) } return SQLITE_OK } @@ -50316,7 +50344,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload - if uint64(int64(aPayload)-int64((*TMemPage)(unsafe.Pointer(pPage)).FaData)) > uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) { + if uint64(int64(int64(aPayload))-int64((*TMemPage)(unsafe.Pointer(pPage)).FaData)) > uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) { /* Trying to read or write past the end of the data is an error. The ** conditional above is really: ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] @@ -50326,14 +50354,14 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { - a = int32(amt) - if uint32(a)+offset > uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { + a = int32(int32(amt)) + if uint32(uint32(a))+offset > uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { a = int32(uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) - offset) } rc = _copyPayload(tls, aPayload+uintptr(offset), pBuf, a, eOp, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) offset = uint32(0) pBuf += uintptr(a) - amt -= uint32(a) + amt -= uint32(uint32(a)) } else { offset -= uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) } @@ -50350,14 +50378,14 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurFlags)&int32(BTCF_ValidOvfl) == 0 { nOvfl = int32(((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload - uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) + ovflSize - uint32(1)) / ovflSize) if (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow == uintptr(0) || nOvfl*libc.Int32FromInt64(4) > _sqlite3MallocSize(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow) { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(uint64(nOvfl*int32(2))*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } else { (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow = aNew } } - libc.Xmemset(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, uint64(nOvfl)*uint64(4)) + libc.Xmemset(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, uint64(uint64(nOvfl))*uint64(4)) p1 = pCur + 1 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(BTCF_ValidOvfl)) } else { @@ -50394,8 +50422,8 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin /* Need to read this page properly. It contains some of the ** range of data that is being read (eOp==0) or written (eOp!=0). */ - a1 = int32(amt) - if uint32(a1)+offset > ovflSize { + a1 = int32(int32(amt)) + if uint32(uint32(a1))+offset > ovflSize { a1 = int32(ovflSize - offset) } /* If all the following are true: @@ -50434,7 +50462,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin offset = uint32(0) } } - amt -= uint32(a1) + amt -= uint32(uint32(a1)) if amt == uint32(0) { return rc } @@ -50542,7 +50570,7 @@ func _fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) (r uintptr) { } amt = v1 } - *(*Tu32)(unsafe.Pointer(pAmt)) = uint32(amt) + *(*Tu32)(unsafe.Pointer(pAmt)) = uint32(uint32(amt)) return (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload } @@ -50713,6 +50741,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { if int32((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { return _sqlite3CorruptError(tls, int32(75683)) } + goto skip_init skip_init: ; (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(0) @@ -50977,7 +51006,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } } else { - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(idx)) if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { lwr = idx goto moveto_table_next_layer @@ -50996,11 +51025,12 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh _2: } if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 { - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(idx)) *(*int32)(unsafe.Pointer(pRes)) = c rc = SQLITE_OK goto moveto_table_finish } + goto moveto_table_next_layer moveto_table_next_layer: ; if lwr >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -51008,7 +51038,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh } else { chldPg = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*lwr))))))) } - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(lwr) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(lwr)) rc = _moveToChild(tls, pCur, chldPg) if rc != 0 { break @@ -51016,6 +51046,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51174,6 +51205,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -51221,7 +51253,7 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x00 */ /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ - if nCell < int32(2) || uint32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { + if nCell < int32(2) || uint32(uint32(nCell))/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { rc = _sqlite3CorruptError(tls, int32(76220)) goto moveto_index_finish } @@ -51230,9 +51262,9 @@ bypass_moveto_root: rc = int32(SQLITE_NOMEM) goto moveto_index_finish } - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) - rc = _accessPayload(tls, pCur, uint32(0), uint32(nCell), pCellKey, 0) - libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, uint64(nOverrun)) /* Fix uninit warnings */ + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(idx)) + rc = _accessPayload(tls, pCur, uint32(0), uint32(uint32(nCell)), pCellKey, 0) + libc.Xmemset(tls, pCellKey+uintptr(nCell), 0, uint64(uint64(nOverrun))) /* Fix uninit warnings */ p8 = pCur + 1 *(*Tu8)(unsafe.Pointer(p8)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p8))) & ^libc.Int32FromInt32(BTCF_ValidOvfl)) if rc != 0 { @@ -51251,7 +51283,7 @@ bypass_moveto_root: } else { *(*int32)(unsafe.Pointer(pRes)) = 0 rc = SQLITE_OK - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(idx)) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { rc = _sqlite3CorruptError(tls, int32(76252)) } @@ -51266,7 +51298,7 @@ bypass_moveto_root: _5: } if (*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0 { - (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) + (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(uint16(idx)) *(*int32)(unsafe.Pointer(pRes)) = c1 rc = SQLITE_OK goto moveto_index_finish @@ -51288,7 +51320,7 @@ bypass_moveto_root: if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { return _sqlite3CorruptError(tls, int32(76283)) } - *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = uint16(lwr) + *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = uint16(uint16(lwr)) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(0) (*TBtCursor)(unsafe.Pointer(pCur)).FiPage++ @@ -51309,6 +51341,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51355,7 +51388,7 @@ func _sqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) (r Ti64) { n = int64((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) i = uint8(0) for { - if !(int32(i) < int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)) { + if !(int32(int32(i)) < int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)) { break } n *= int64((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(i)*8)))).FnCell) @@ -51630,7 +51663,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** shows that the page 'nearby' is somewhere on the free-list, then ** the entire-list will be searched for that page. */ - if int32(eMode) == int32(BTALLOC_EXACT) { + if int32(int32(eMode)) == int32(BTALLOC_EXACT) { if nearby <= mxPage { rc = _ptrmapGet(tls, pBt, nearby, bp+8, uintptr(0)) if rc != 0 { @@ -51641,7 +51674,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } } else { - if int32(eMode) == int32(BTALLOC_LE) { + if int32(int32(eMode)) == int32(BTALLOC_LE) { searchList = uint8(1) } } @@ -51705,7 +51738,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt rc = _sqlite3CorruptError(tls, int32(76663)) goto end_allocate_page } else { - if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { + if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(int32(eMode)) == int32(BTALLOC_LE)) { /* The list is being searched and this trunk page is the page ** to allocate, regardless of whether it has leaves. */ @@ -51761,7 +51794,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt aData = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData if nearby > uint32(0) { closest = uint32(0) - if int32(eMode) == int32(BTALLOC_LE) { + if int32(int32(eMode)) == int32(BTALLOC_LE) { i = uint32(0) for { if !(i < k) { @@ -51803,7 +51836,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt rc = _sqlite3CorruptError(tls, int32(76762)) goto end_allocate_page } - if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { + if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(int32(eMode)) == int32(BTALLOC_LE)) { *(*TPgno)(unsafe.Pointer(pPgno)) = iPage rc = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) if rc != 0 { @@ -51866,7 +51899,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt return rc } (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ - if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ } if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 && _ptrmapPageno(tls, pBt, (*TBtShared)(unsafe.Pointer(pBt)).FnPage) == (*TBtShared)(unsafe.Pointer(pBt)).FnPage { @@ -51884,7 +51917,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt return rc } (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ - if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + if (*TBtShared)(unsafe.Pointer(pBt)).FnPage == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { (*TBtShared)(unsafe.Pointer(pBt)).FnPage++ } } @@ -51900,6 +51933,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52052,6 +52086,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -52215,7 +52250,7 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize *(*uint8)(unsafe.Pointer(pPayload + uintptr(nPayload))) = uint8(0) } *(*int32)(unsafe.Pointer(pnSize)) = n - libc.Xmemcpy(tls, pPayload, pSrc, uint64(nSrc)) + libc.Xmemcpy(tls, pPayload, pSrc, uint64(uint64(nSrc))) libc.Xmemset(tls, pPayload+uintptr(nSrc), 0, uint64(nPayload-nSrc)) return SQLITE_OK } @@ -52223,7 +52258,7 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize ** to spill onto overflow pages. */ mn = int32((*TMemPage)(unsafe.Pointer(pPage)).FminLocal) - n = int32(uint32(mn) + uint32(nPayload-mn)%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) + n = int32(uint32(uint32(mn)) + uint32(nPayload-mn)%((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4))) if n > int32((*TMemPage)(unsafe.Pointer(pPage)).FmaxLocal) { n = mn } @@ -52256,13 +52291,13 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize /* If pPayload is part of the data area of pPage, then make sure pPage ** is still writeable */ if nSrc >= n { - libc.Xmemcpy(tls, pPayload, pSrc, uint64(n)) + libc.Xmemcpy(tls, pPayload, pSrc, uint64(uint64(n))) } else { if nSrc > 0 { n = nSrc - libc.Xmemcpy(tls, pPayload, pSrc, uint64(n)) + libc.Xmemcpy(tls, pPayload, pSrc, uint64(uint64(n))) } else { - libc.Xmemset(tls, pPayload, 0, uint64(n)) + libc.Xmemset(tls, pPayload, 0, uint64(uint64(n))) } } nPayload -= n @@ -52277,7 +52312,7 @@ func _fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pgnoPtrmap = *(*TPgno)(unsafe.Pointer(bp + 4)) /* Overflow page pointer-map entry page */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - for cond := true; cond; cond = _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) == *(*TPgno)(unsafe.Pointer(bp + 4)) || *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for cond := true; cond; cond = _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4))) == *(*TPgno)(unsafe.Pointer(bp + 4)) || *(*TPgno)(unsafe.Pointer(bp + 4)) == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { *(*TPgno)(unsafe.Pointer(bp + 4))++ } } @@ -52347,11 +52382,11 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { ptr = (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*idx) pc = uint32(int32(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { + if pc+uint32(uint32(sz)) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77329)) return } - rc = _freeSpace(tls, pPage, uint16(pc), uint16(sz)) + rc = _freeSpace(tls, pPage, uint16(uint16(pc)), uint16(uint16(sz))) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52405,7 +52440,7 @@ func _insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, *(*int32)(unsafe.Pointer(bp)) = 0 /* The point in pPage->aCellIdx[] where no cell inserted */ if (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow != 0 || sz+int32(2) > (*TMemPage)(unsafe.Pointer(pPage)).FnFree { if pTemp != 0 { - libc.Xmemcpy(tls, pTemp, pCell, uint64(sz)) + libc.Xmemcpy(tls, pTemp, pCell, uint64(uint64(sz))) pCell = pTemp } _sqlite3Put4byte(tls, pCell, iChild) @@ -52417,7 +52452,7 @@ func _insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, ** as a contingency. In other words, never need more than 3 overflow ** slots but 4 are allocated, just to be safe. */ *(*uintptr)(unsafe.Pointer(pPage + 40 + uintptr(j)*8)) = pCell - *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(uint16(i)) /* When multiple overflows occur, they are always sequential and in ** sorted order. This invariants arise because multiple overflows can ** only occur when inserting divider cells into the parent page during @@ -52502,7 +52537,7 @@ func _insertCellFast(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz in ** as a contingency. In other words, never need more than 3 overflow ** slots but 4 are allocated, just to be safe. */ *(*uintptr)(unsafe.Pointer(pPage + 40 + uintptr(j)*8)) = pCell - *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pPage + 28 + uintptr(j)*2)) = uint16(uint16(i)) /* When multiple overflows occur, they are always sequential and in ** sorted order. This invariants arise because multiple overflows can ** only occur when inserting divider cells into the parent page during @@ -52523,7 +52558,7 @@ func _insertCellFast(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz in /* The allocateSpace() routine guarantees the following properties ** if it returns successfully */ *(*int32)(unsafe.Pointer(pPage + 20)) -= int32(uint16(libc.Int32FromInt32(2) + sz)) - libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, uint64(sz)) + libc.Xmemcpy(tls, data+uintptr(*(*int32)(unsafe.Pointer(bp))), pCell, uint64(uint64(sz))) pIns = (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(i*int32(2)) libc.Xmemmove(tls, pIns+uintptr(2), pIns, uint64(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell)-i))) *(*Tu8)(unsafe.Pointer(pIns)) = uint8(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) @@ -52721,10 +52756,10 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg pCellptr = (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx pTmp = _sqlite3PagerTempSpace(tls, (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPg)).FpBt)).FpPager) /* Current pCArray->apEnd[k] value */ j = uint32(int32(*(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))))< uint32(usableSize) { + if j > uint32(uint32(usableSize)) { j = uint32(0) } - libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), uint64(uint32(usableSize)-j)) + libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), uint64(uint32(uint32(usableSize))-j)) k = 0 for { if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i) { @@ -52741,23 +52776,23 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg pCell = *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)) sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { - if uint64(pCell+uintptr(sz)) > uint64(pEnd) { + if uint64(pCell+uintptr(sz)) > uint64(uint64(pEnd)) { return _sqlite3CorruptError(tls, int32(77718)) } - pCell = pTmp + uintptr(int64(pCell)-int64(aData)) + pCell = pTmp + uintptr(int64(int64(pCell))-int64(int64(aData))) } else { - if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { + if uint64(pCell+uintptr(sz)) > uint64(uint64(pSrcEnd)) && uint64(pCell) < uint64(uint64(pSrcEnd)) { return _sqlite3CorruptError(tls, int32(77723)) } } pData -= uintptr(sz) - *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int64(pData) - int64(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int64(pData) - int64(aData)) + *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int64(int64(pData)) - int64(int64(aData))) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int64(int64(pData)) - int64(int64(aData))) pCellptr += uintptr(2) if pData < pCellptr { return _sqlite3CorruptError(tls, int32(77729)) } - libc.Xmemmove(tls, pData, pCell, uint64(sz)) + libc.Xmemmove(tls, pData, pCell, uint64(uint64(sz))) i++ if i >= iEnd { break @@ -52768,14 +52803,14 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg } } /* The pPg->nFree field is now set incorrectly. The caller will fix it. */ - (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(nCell) + (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(uint16(nCell)) (*TMemPage)(unsafe.Pointer(pPg)).FnOverflow = uint8(0) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)))) = uint8(libc.Int32FromInt32(0) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(1)) + 1)) = uint8(libc.Int32FromInt32(0)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = uint8(int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)) + 1)) = uint8((*TMemPage)(unsafe.Pointer(pPg)).FnCell) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(pData) - int64(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(pData) - int64(aData)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(int64(pData)) - int64(int64(aData))) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(int64(pData)) - int64(int64(aData))) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(7)))) = uint8(0x00) return SQLITE_OK } @@ -52840,7 +52875,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr pSlot = v2 } if v3 || v2 == uintptr(0) { - if int64(pData)-int64(pBegin) < int64(sz) { + if int64(int64(pData))-int64(int64(pBegin)) < int64(int64(sz)) { return int32(1) } pData -= uintptr(sz) @@ -52849,13 +52884,13 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr /* pSlot and pCArray->apCell[i] will never overlap on a well-formed ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ - if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { + if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(uint64(pEnd)) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(uint64(pEnd)) { _sqlite3CorruptError(tls, int32(77814)) return int32(1) } - libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz)) - *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int64(pSlot) - int64(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int64(pSlot) - int64(aData)) + libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(uint64(sz))) + *(*Tu8)(unsafe.Pointer(pCellptr)) = uint8((int64(int64(pSlot)) - int64(int64(aData))) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int64(int64(pSlot)) - int64(int64(aData))) pCellptr += uintptr(2) i++ if i >= iEnd { @@ -52903,7 +52938,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr ** are to be freed have already been computing while deciding which ** cells need freeing */ sz = int32(*(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2))) - iOfst = int32(uint16(int64(pCell) - int64(aData))) + iOfst = int32(uint16(int64(int64(pCell)) - int64(int64(aData)))) iAfter = iOfst + sz j = 0 for { @@ -53057,13 +53092,14 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if _pageInsertArray(tls, pPg, pBegin, bp, pCellptr, iNew+nCell, nNew-nCell, pCArray) != 0 { goto editpage_fail } - (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(nNew) + (*TMemPage)(unsafe.Pointer(pPg)).FnCell = uint16(uint16(nNew)) (*TMemPage)(unsafe.Pointer(pPg)).FnOverflow = uint8(0) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)))) = uint8(int32((*TMemPage)(unsafe.Pointer(pPg)).FnCell) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(3)) + 1)) = uint8((*TMemPage)(unsafe.Pointer(pPg)).FnCell) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(int64(aData))) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(int64(aData))) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -53188,7 +53224,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt } /* Insert the new divider cell into pParent. */ if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _insertCell(tls, pParent, int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, int32(int64(pOut)-int64(pSpace)), uintptr(0), (*TMemPage)(unsafe.Pointer(pPage)).Fpgno) + *(*int32)(unsafe.Pointer(bp + 8)) = _insertCell(tls, pParent, int32((*TMemPage)(unsafe.Pointer(pParent)).FnCell), pSpace, int32(int64(int64(pOut))-int64(int64(pSpace))), uintptr(0), (*TMemPage)(unsafe.Pointer(pPage)).Fpgno) } /* Set the right-child pointer of pParent to point to the new page. */ _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pParent)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pParent)).FhdrOffset)+int32(8)), *(*TPgno)(unsafe.Pointer(bp + 12))) @@ -53234,7 +53270,7 @@ func _copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { iToHdr = v1 /* Copy the b-tree node content from page pFrom to page pTo. */ iData = int32(*(*Tu8)(unsafe.Pointer(aFrom + uintptr(iFromHdr+int32(5)))))< int32((*TBtShared)(unsafe.Pointer(pBt)).FusableSize*libc.Uint32FromInt32(2)/libc.Uint32FromInt32(3)) || int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == int32(1) { /* A b-tree rebalance will be required after deleting this entry. @@ -55141,7 +55179,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { *(*int32)(unsafe.Pointer(bp)) = _balance(tls, pCur) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if int32(bPreserve) > int32(1) { + if int32(int32(bPreserve)) > int32(1) { (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_SKIPNEXT) if iCellIdx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { (*TBtCursor)(unsafe.Pointer(pCur)).FskipNext = -int32(1) @@ -55189,7 +55227,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags var _ /* pgnoRoot at bp+8 */ TPgno var _ /* rc at bp+12 */ int32 _, _ = pBt, ptfFlags - pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Page-type flags for the root page of new table */ + pBt = (*TBtree)(unsafe.Pointer(p)).FpBt /* Page-type flags for the root page of new table */ if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { /* The page to move to. */ /* Creating a new table may probably require moving an existing database ** to make room for the new tables root page. In case this page turns @@ -55209,7 +55247,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags /* The new root-page may not be allocated on a pointer-map page, or the ** PENDING_BYTE page. */ - for *(*TPgno)(unsafe.Pointer(bp + 8)) == _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8))) || *(*TPgno)(unsafe.Pointer(bp + 8)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { + for *(*TPgno)(unsafe.Pointer(bp + 8)) == _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8))) || *(*TPgno)(unsafe.Pointer(bp + 8)) == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) { *(*TPgno)(unsafe.Pointer(bp + 8))++ } /* Allocate a page. The page that currently resides at pgnoRoot will @@ -55383,6 +55421,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55409,15 +55448,15 @@ func _sqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui _, _ = pBt, rc pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) - rc = _saveAllCursors(tls, pBt, uint32(iTable), uintptr(0)) + rc = _saveAllCursors(tls, pBt, uint32(uint32(iTable)), uintptr(0)) if SQLITE_OK == rc { /* Invalidate all incrblob cursors open on table iTable (assuming iTable ** is the root of a table b-tree - if it is not, the following call is ** a no-op). */ if (*TBtree)(unsafe.Pointer(p)).FhasIncrblobCur != 0 { - _invalidateIncrblobCursors(tls, p, uint32(iTable), 0, int32(1)) + _invalidateIncrblobCursors(tls, p, uint32(uint32(iTable)), 0, int32(1)) } - rc = _clearDatabasePage(tls, pBt, uint32(iTable), 0, pnChange) + rc = _clearDatabasePage(tls, pBt, uint32(uint32(iTable)), 0, pnChange) } _sqlite3BtreeLeave(tls, p) return rc @@ -55470,7 +55509,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r if iTable > _btreePagecount(tls, pBt) { return _sqlite3CorruptError(tls, int32(80361)) } - *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(int32(iTable)), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } @@ -55517,7 +55556,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r ** PENDING_BYTE_PAGE. */ *(*TPgno)(unsafe.Pointer(bp + 16))-- - for *(*TPgno)(unsafe.Pointer(bp + 16)) == uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 16))) == *(*TPgno)(unsafe.Pointer(bp + 16)) { + for *(*TPgno)(unsafe.Pointer(bp + 16)) == uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer(pBt)).FpageSize+libc.Uint32FromInt32(1) || _ptrmapPageno(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 16))) == *(*TPgno)(unsafe.Pointer(bp + 16)) { *(*TPgno)(unsafe.Pointer(bp + 16))-- } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeUpdateMeta(tls, p, int32(4), *(*TPgno)(unsafe.Pointer(bp + 16))) @@ -55532,7 +55571,7 @@ func _sqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uint var rc int32 _ = rc _sqlite3BtreeEnter(tls, p) - rc = _btreeDropTable(tls, p, uint32(iTable), piMoved) + rc = _btreeDropTable(tls, p, uint32(uint32(iTable)), piMoved) _sqlite3BtreeLeave(tls, p) return rc } @@ -55591,7 +55630,7 @@ func _sqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta Tu32) (r if rc == SQLITE_OK { _sqlite3Put4byte(tls, pP1+uintptr(int32(36)+idx*int32(4)), iMeta) if idx == int32(BTREE_INCR_VACUUM) { - (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(iMeta) + (*TBtShared)(unsafe.Pointer(pBt)).FincrVacuum = uint8(uint8(iMeta)) } } _sqlite3BtreeLeave(tls, p) @@ -55814,8 +55853,8 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen _checkAppendMsg(tls, pCheck, __ccgo_ts+4257, libc.VaList(bp+16, iChild)) return } - if int32(*(*Tu8)(unsafe.Pointer(bp))) != int32(eType) || *(*TPgno)(unsafe.Pointer(bp + 4)) != iParent { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4286, libc.VaList(bp+16, iChild, int32(eType), iParent, int32(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) + if int32(*(*Tu8)(unsafe.Pointer(bp))) != int32(int32(eType)) || *(*TPgno)(unsafe.Pointer(bp + 4)) != iParent { + _checkAppendMsg(tls, pCheck, __ccgo_ts+4286, libc.VaList(bp+16, iChild, int32(int32(eType)), iParent, int32(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) } } @@ -55857,7 +55896,7 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } else { i = 0 for { - if !(i < int32(n)) { + if !(i < int32(int32(n))) { break } iFreePage = _sqlite3Get4byte(tls, pOvflData+uintptr(int32(8)+i*int32(4))) @@ -55879,7 +55918,7 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N */ if (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 && N > uint32(0) { i = int32(_sqlite3Get4byte(tls, pOvflData)) - _checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) + _checkPtrmap(tls, pCheck, uint32(uint32(i)), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = _sqlite3Get4byte(tls, pOvflData) @@ -56073,9 +56112,9 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr pgno = int32(_sqlite3Get4byte(tls, data+uintptr(hdr+int32(8)))) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4595 - _checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) + _checkPtrmap(tls, pCheck, uint32(uint32(pgno)), uint8(PTRMAP_BTREE), iPage) } - depth = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) + depth = _checkTreePage(tls, pCheck, uint32(uint32(pgno)), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 } else { /* For leaf pages, the coverage check will occur in the same loop @@ -56132,9 +56171,9 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr /* Check sanity of left child page for internal pages */ pgno = int32(_sqlite3Get4byte(tls, pCell)) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - _checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) + _checkPtrmap(tls, pCheck, uint32(uint32(pgno)), uint8(PTRMAP_BTREE), iPage) } - d2 = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) + d2 = _checkTreePage(tls, pCheck, uint32(uint32(pgno)), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { _checkAppendMsg(tls, pCheck, __ccgo_ts+4703, 0) @@ -56185,7 +56224,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr /* Enforced by btreeComputeFreeSpace() */ size1 = int32(*(*Tu8)(unsafe.Pointer(data + uintptr(i+int32(2)))))< uint32(nSrcPage) { + if (*Tsqlite3_backup)(unsafe.Pointer(p)).FiNext > uint32(uint32(nSrcPage)) { rc = int32(SQLITE_DONE) } else { if !((*Tsqlite3_backup)(unsafe.Pointer(p)).FisAttached != 0) { @@ -57197,7 +57238,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { if pgszSrc < pgszDest { ratio = pgszDest / pgszSrc nDestTruncate = (nSrcPage + ratio - int32(1)) / ratio - if nDestTruncate == int32(uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1)) { + if nDestTruncate == int32(uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1)) { nDestTruncate-- } } else { @@ -57213,7 +57254,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { ** pending-byte page in the source database may need to be ** copied into the destination database. */ - iSize = int64(pgszSrc) * int64(nSrcPage) + iSize = int64(int64(pgszSrc)) * int64(int64(nSrcPage)) pFile = _sqlite3PagerFile(tls, pDestPager) /* This block ensures that all data required to recreate the original ** database has been stored in the journal for pDestPager and the @@ -57222,12 +57263,12 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { ** occurs, the original database will be reconstructed from the ** journal file. */ _sqlite3PagerPagecount(tls, pDestPager, bp+8) - iPg = uint32(nDestTruncate) + iPg = uint32(uint32(nDestTruncate)) for { if !(rc == SQLITE_OK && iPg <= uint32(*(*int32)(unsafe.Pointer(bp + 8)))) { break } - if iPg != uint32(_sqlite3PendingByte)/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { + if iPg != uint32(uint32(_sqlite3PendingByte))/(*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer((*Tsqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize+libc.Uint32FromInt32(1) { rc = _sqlite3PagerGet(tls, pDestPager, iPg, bp+16, 0) if rc == SQLITE_OK { rc = _sqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) @@ -57255,7 +57296,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { break } *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) - iSrcPg1 = uint32(iOff/int64(pgszSrc) + libc.Int64FromInt32(1)) + iSrcPg1 = uint32(iOff/int64(int64(pgszSrc)) + libc.Int64FromInt32(1)) rc = _sqlite3PagerGet(tls, pSrcPager, iSrcPg1, bp+24, 0) if rc == SQLITE_OK { zData = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) @@ -57265,7 +57306,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { goto _6 _6: ; - iOff += int64(pgszSrc) + iOff += int64(int64(pgszSrc)) } if rc == SQLITE_OK { rc = _backupTruncateFile(tls, pFile, iSize) @@ -57275,7 +57316,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) (r int32) { rc = _sqlite3PagerSync(tls, pDestPager, uintptr(0)) } } else { - _sqlite3PagerTruncateImage(tls, pDestPager, uint32(nDestTruncate)) + _sqlite3PagerTruncateImage(tls, pDestPager, uint32(uint32(nDestTruncate))) rc = _sqlite3PagerCommitPhaseOne(tls, pDestPager, uintptr(0), 0) } /* Finish committing the transaction to the destination database. */ @@ -57513,6 +57554,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -57594,7 +57636,7 @@ func _sqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) ( var rc int32 _ = rc if !(int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&libc.Int32FromInt32(MEM_Str) != 0) { - (*TMem)(unsafe.Pointer(pMem)).Fenc = uint8(desiredEnc) + (*TMem)(unsafe.Pointer(pMem)).Fenc = uint8(uint8(desiredEnc)) return SQLITE_OK } if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc { @@ -57603,7 +57645,7 @@ func _sqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) ( /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned, ** then the encoding of the value may not have changed. */ - rc = _sqlite3VdbeMemTranslate(tls, pMem, uint8(desiredEnc)) + rc = _sqlite3VdbeMemTranslate(tls, pMem, uint8(uint8(desiredEnc))) return rc } @@ -57624,11 +57666,11 @@ func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) ** contain a valid string or blob value. */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 && bPreserve != 0 && (*TMem)(unsafe.Pointer(pMem)).Fz == (*TMem)(unsafe.Pointer(pMem)).FzMalloc { if (*TMem)(unsafe.Pointer(pMem)).Fdb != 0 { - v1 = _sqlite3DbReallocOrFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(n)) + v1 = _sqlite3DbReallocOrFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(uint64(n))) (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = v1 } else { - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3Realloc(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(n)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3Realloc(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, uint64(uint64(n))) if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { Xsqlite3_free(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) } @@ -57639,7 +57681,7 @@ func _sqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(n)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(uint64(n))) } if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { _sqlite3VdbeMemSetNull(tls, pMem) @@ -57866,7 +57908,7 @@ func _sqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc Tu8, bForce Tu8) p2 = pMem + 20 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } - _sqlite3VdbeChangeEncoding(tls, pMem, int32(enc)) + _sqlite3VdbeChangeEncoding(tls, pMem, int32(int32(enc))) return SQLITE_OK } @@ -58113,7 +58155,7 @@ func _sqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { ** the second condition under the assumption that addition overflow causes ** values to wrap around. */ - if *(*float64)(unsafe.Pointer(pMem)) == float64(ix) && ix > int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)< int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<= -int64(2251799813685248) && i < int64(2251799813685248)) } @@ -58176,7 +58218,7 @@ func _sqlite3RealToI64(tls *libc.TLS, r float64) (r1 Ti64) { if r > +libc.Float64FromFloat64(9.223372036854775e+18) { return libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)< int64(iLimit) { + if nByte > int64(int64(iLimit)) { if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { if xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) @@ -58596,8 +58638,8 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T */ if xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte - if int32(flags)&int32(MEM_Term) != 0 { - if int32(enc) == int32(SQLITE_UTF8) { + if int32(int32(flags))&int32(MEM_Term) != 0 { + if int32(int32(enc)) == int32(SQLITE_UTF8) { v2 = int32(1) } else { v2 = int32(2) @@ -58612,7 +58654,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T if _sqlite3VdbeMemClearAndResize(tls, pMem, int32(v3)) != 0 { return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, z, uint64(nAlloc)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, z, uint64(uint64(nAlloc))) } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z @@ -58632,7 +58674,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T (*TMem)(unsafe.Pointer(pMem)).Fn = int32(nByte & libc.Int64FromInt32(0x7fffffff)) (*TMem)(unsafe.Pointer(pMem)).Fflags = flags (*TMem)(unsafe.Pointer(pMem)).Fenc = enc - if int32(enc) > int32(SQLITE_UTF8) && _sqlite3VdbeMemHandleBom(tls, pMem) != 0 { + if int32(int32(enc)) > int32(SQLITE_UTF8) && _sqlite3VdbeMemHandleBom(tls, pMem) != 0 { return int32(SQLITE_NOMEM) } return SQLITE_OK @@ -58669,7 +58711,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = 0 /* Overrun area used when reading malformed records */ (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Blob) - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(amt) + (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int32(amt)) } else { _sqlite3VdbeMemRelease(tls, pMem) } @@ -58690,7 +58732,7 @@ func _sqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt Tu32, p (*TMem)(unsafe.Pointer(pMem)).Fz = _sqlite3BtreePayloadFetch(tls, pCur, bp) if amt <= *(*Tu32)(unsafe.Pointer(bp)) { (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Ephem)) - (*TMem)(unsafe.Pointer(pMem)).Fn = int32(amt) + (*TMem)(unsafe.Pointer(pMem)).Fn = int32(int32(amt)) } else { rc = _sqlite3VdbeMemFromBtree(tls, pCur, uint32(0), amt, pMem) } @@ -58719,10 +58761,10 @@ func _valueToText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { } p2 = pVal + 20 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(MEM_Str)) - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { - _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) + if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(int32(enc)) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { + _sqlite3VdbeChangeEncoding(tls, pVal, int32(int32(enc)) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) } - if int32(enc)&int32(SQLITE_UTF16_ALIGNED) != 0 && int32(1) == int32(1)&int32(int64((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz)) { + if int32(int32(enc))&int32(SQLITE_UTF16_ALIGNED) != 0 && int32(1) == int32(1)&int32(int64((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz)) { if _sqlite3VdbeMemMakeWriteable(tls, pVal) != SQLITE_OK { return uintptr(0) } @@ -58731,7 +58773,7 @@ func _valueToText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { } else { _sqlite3VdbeMemStringify(tls, pVal, enc, uint8(0)) } - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { + if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(int32(enc)) & ^libc.Int32FromInt32(SQLITE_UTF16_ALIGNED) { return (*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz } else { return uintptr(0) @@ -58755,7 +58797,7 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { if !(pVal != 0) { return uintptr(0) } - if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)) == libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) { + if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term)) == libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Term) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(int32(enc)) { return (*Tsqlite3_value)(unsafe.Pointer(pVal)).Fz } if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Null) != 0 { @@ -58832,8 +58874,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = int32(uint64(56)*uint64(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = int32(uint64(56)*uint64(uint64(nCol)) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte))) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58911,7 +58953,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*uint64(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*uint64(uint64(nVal)))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -58946,12 +58988,13 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3799, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) - rc = _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) + rc = _sqlite3VdbeChangeEncoding(tls, pVal, int32(int32(enc))) if rc == SQLITE_OK && _sqlite3VdbeMemTooBig(tls, pVal) != 0 { rc = int32(SQLITE_TOOBIG) (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -59046,7 +59089,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity goto no_mem } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != uint32(0) { - _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), int64(*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fu)))*int64(negInt)) + _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), int64(*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fu)))*int64(int64(negInt))) } else { zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5080, libc.VaList(bp+16, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { @@ -59054,7 +59097,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } _sqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp)), -int32(1), zVal, uint8(SQLITE_UTF8), __ccgo_fp(_sqlite3OomClear)) } - if (op == int32(TK_INTEGER) || op == int32(TK_FLOAT)) && int32(affinity) == int32(SQLITE_AFF_BLOB) { + if (op == int32(TK_INTEGER) || op == int32(TK_FLOAT)) && int32(int32(affinity)) == int32(SQLITE_AFF_BLOB) { _sqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8)) } else { _sqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp)), affinity, uint8(SQLITE_UTF8)) @@ -59063,8 +59106,8 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity p3 = *(*uintptr)(unsafe.Pointer(bp)) + 20 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(MEM_Str)) } - if int32(enc) != int32(SQLITE_UTF8) { - rc = _sqlite3VdbeChangeEncoding(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(enc)) + if int32(int32(enc)) != int32(SQLITE_UTF8) { + rc = _sqlite3VdbeChangeEncoding(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(int32(enc))) } } else { if op == int32(TK_UMINUS) { @@ -59118,6 +59161,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -59417,7 +59461,7 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // */ func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(int64(n)), enc, xDel) } } @@ -59456,10 +59500,10 @@ func _sqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc Tu8) (r int32) { var p uintptr _ = p p = pVal - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc) { + if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(int32(enc)) { return (*TMem)(unsafe.Pointer(p)).Fn } - if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32(enc) != int32(SQLITE_UTF8) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(SQLITE_UTF8) { + if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Str) != 0 && int32(int32(enc)) != int32(SQLITE_UTF8) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fenc) != int32(SQLITE_UTF8) { return (*TMem)(unsafe.Pointer(p)).Fn } if int32((*TMem)(unsafe.Pointer(p)).Fflags)&int32(MEM_Blob) != 0 { @@ -59535,10 +59579,10 @@ func _sqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags return } (*TVdbe)(unsafe.Pointer(p)).FprepFlags = prepFlags - if int32(prepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { + if int32(int32(prepFlags))&int32(SQLITE_PREPARE_SAVESQL) == 0 { (*TVdbe)(unsafe.Pointer(p)).Fexpmask = uint32(0) } - (*TVdbe)(unsafe.Pointer(p)).FzSql = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, z, uint64(n)) + (*TVdbe)(unsafe.Pointer(p)).FzSql = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, z, uint64(uint64(n))) } // C documentation @@ -59613,7 +59657,7 @@ func _growOpArray(tls *libc.TLS, v uintptr, nOp int32) (r int32) { _sqlite3OomFault(tls, (*TParse)(unsafe.Pointer(p)).Fdb) return int32(SQLITE_NOMEM) } - pNew = _sqlite3DbRealloc(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(v)).FaOp, uint64(nNew)*uint64(24)) + pNew = _sqlite3DbRealloc(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TVdbe)(unsafe.Pointer(v)).FaOp, uint64(uint64(nNew))*uint64(24)) if pNew != 0 { (*TParse)(unsafe.Pointer(p)).FszOpAlloc = _sqlite3DbMallocSize(tls, (*TParse)(unsafe.Pointer(p)).Fdb, pNew) (*TVdbe)(unsafe.Pointer(v)).FnOpAlloc = int32(uint64((*TParse)(unsafe.Pointer(p)).FszOpAlloc) / uint64(24)) @@ -59690,7 +59734,7 @@ func _sqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, } (*TVdbe)(unsafe.Pointer(p)).FnOp++ pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*24 - (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(op) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(uint8(op)) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(0) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 @@ -59714,7 +59758,7 @@ func _sqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int3 } (*TVdbe)(unsafe.Pointer(p)).FnOp++ pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*24 - (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(op) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode = uint8(uint8(op)) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(0) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1 (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 @@ -59772,7 +59816,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr if !(int32(v2) != 0) { break } - if int32(c) == int32('s') { + if int32(int32(c)) == int32('s') { z = libc.VaUintptr(&ap) if z == uintptr(0) { v3 = int32(OP_Null) @@ -59781,7 +59825,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr } _sqlite3VdbeAddOp4(tls, p, v3, 0, iDest+i, 0, z, 0) } else { - if int32(c) == int32('i') { + if int32(int32(c)) == int32('i') { _sqlite3VdbeAddOp2(tls, p, int32(OP_Integer), libc.VaInt32(&ap), iDest+i) } else { goto skip_op_resultrow @@ -59793,6 +59837,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -59829,7 +59874,7 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int _, _, _, _, _ = addr, nByte, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe nByte = int32(uint64(56) + uint64(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(nByte))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59838,7 +59883,7 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = pFunc (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = uintptr(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(nArg) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(uint8(nArg)) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = _sqlite3VdbeCurrentAddr(tls, v) if eCallCtx != 0 { v1 = int32(OP_PureFunc) @@ -60020,7 +60065,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(uint64(uint64(nNewSize))*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -60168,6 +60213,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -60497,7 +60543,7 @@ func _sqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) (r int32) { // ** then remove it. Return true if and only if an opcode was removed. // */ func _sqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op Tu8) (r int32) { - if (*TVdbe)(unsafe.Pointer(p)).FnOp > 0 && int32((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*24))).Fopcode) == int32(op) { + if (*TVdbe)(unsafe.Pointer(p)).FnOp > 0 && int32((*(*TOp)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*24))).Fopcode) == int32(int32(op)) { return _sqlite3VdbeChangeToNoop(tls, p, (*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1)) } else { return 0 @@ -60530,12 +60576,12 @@ func _vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int *(*uintptr)(unsafe.Pointer(pOp + 16)) = uintptr(0) } if n < 0 { - _sqlite3VdbeChangeP4(tls, p, int32((int64(pOp)-int64((*TVdbe)(unsafe.Pointer(p)).FaOp))/24), zP4, n) + _sqlite3VdbeChangeP4(tls, p, int32((int64(int64(pOp))-int64((*TVdbe)(unsafe.Pointer(p)).FaOp))/24), zP4, n) } else { if n == 0 { n = _sqlite3Strlen30(tls, zP4) } - *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(n)) + *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3DbStrNDup(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, zP4, uint64(uint64(n))) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) } } @@ -60569,7 +60615,7 @@ func _sqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, _zP4 uintptr, n } else { if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(0) { *(*uintptr)(unsafe.Pointer(pOp + 16)) = *(*uintptr)(unsafe.Pointer(bp)) - (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(n) + (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(int8(n)) if n == -int32(11) { _sqlite3VtabLock(tls, *(*uintptr)(unsafe.Pointer(bp))) } @@ -60595,7 +60641,7 @@ func _sqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { _freeP4(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, n, pP4) } else { pOp = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr((*TVdbe)(unsafe.Pointer(p)).FnOp-int32(1))*24 - (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(n) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(int8(n)) *(*uintptr)(unsafe.Pointer(pOp + 16)) = pP4 } } @@ -61110,7 +61156,7 @@ func _sqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, nSub++ *(*uintptr)(unsafe.Pointer(apSub + uintptr(v5)*8)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16)) (*TMem)(unsafe.Pointer(pSub)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pSub)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Blob)) - (*TMem)(unsafe.Pointer(pSub)).Fn = int32(uint64(nSub) * uint64(8)) + (*TMem)(unsafe.Pointer(pSub)).Fn = int32(uint64(uint64(nSub)) * uint64(8)) nRow += (*TSubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16)))).FnOp } } @@ -61361,8 +61407,8 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { ** opcode array. This extra memory will be reallocated for other elements ** of the prepared statement. */ - n = int32(libc.Uint64FromInt64(24) * uint64((*TVdbe)(unsafe.Pointer(p)).FnOp)) /* Bytes of opcode memory used */ - (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FpSpace = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(n) /* Unused opcode memory */ + n = int32(libc.Uint64FromInt64(24) * uint64((*TVdbe)(unsafe.Pointer(p)).FnOp)) /* Bytes of opcode memory used */ + (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FpSpace = (*TVdbe)(unsafe.Pointer(p)).FaOp + uintptr(n) /* Unused opcode memory */ (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnFree = int64(((*TParse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & ^libc.Int32FromInt32(7)) /* Bytes of unused memory */ _resolveP2Values(tls, p, bp) libc.SetBitFieldPtr16Uint32(p+200, uint32(libc.BoolUint8((*TParse)(unsafe.Pointer(pParse)).FisMultiWrite != 0 && (*TParse)(unsafe.Pointer(pParse)).FmayAbort != 0)), 5, 0x20) @@ -61385,20 +61431,20 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { ** reduce the amount of memory held by a prepared statement. */ (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnNeeded = 0 - (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(nMem)*uint64(56))) - (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(nVar)*uint64(56))) + (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(uint64(nMem))*uint64(56))) + (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(uint64(nVar))*uint64(56))) (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(8))) - (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(nCursor)*uint64(8))) + (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+8, uintptr(0), int64(uint64(uint64(nCursor))*uint64(8))) if (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnNeeded != 0 { v1 = _sqlite3DbMallocRawNN(tls, db, uint64((*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnNeeded)) (*TVdbe)(unsafe.Pointer(p)).FpFree = v1 (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FpSpace = v1 (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnFree = (*(*TReusableSpace)(unsafe.Pointer(bp + 8))).FnNeeded if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FaMem, int64(uint64(nMem)*uint64(56))) - (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FaVar, int64(uint64(nVar)*uint64(56))) + (*TVdbe)(unsafe.Pointer(p)).FaMem = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FaMem, int64(uint64(uint64(nMem))*uint64(56))) + (*TVdbe)(unsafe.Pointer(p)).FaVar = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FaVar, int64(uint64(uint64(nVar))*uint64(56))) (*TVdbe)(unsafe.Pointer(p)).FapArg = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FapArg, int64(uint64(*(*int32)(unsafe.Pointer(bp)))*uint64(8))) - (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FapCsr, int64(uint64(nCursor)*uint64(8))) + (*TVdbe)(unsafe.Pointer(p)).FapCsr = _allocSpace(tls, bp+8, (*TVdbe)(unsafe.Pointer(p)).FapCsr, int64(uint64(uint64(nCursor))*uint64(8))) } } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -61407,11 +61453,11 @@ func _sqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { (*TVdbe)(unsafe.Pointer(p)).FnMem = 0 } else { (*TVdbe)(unsafe.Pointer(p)).FnCursor = nCursor - (*TVdbe)(unsafe.Pointer(p)).FnVar = int16(nVar) + (*TVdbe)(unsafe.Pointer(p)).FnVar = int16(int16(nVar)) _initMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*TVdbe)(unsafe.Pointer(p)).FnMem = nMem _initMemArray(tls, (*TVdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) - libc.Xmemset(tls, (*TVdbe)(unsafe.Pointer(p)).FapCsr, 0, uint64(nCursor)*uint64(8)) + libc.Xmemset(tls, (*TVdbe)(unsafe.Pointer(p)).FapCsr, 0, uint64(uint64(nCursor))*uint64(8)) } _sqlite3VdbeRewind(tls, p) } @@ -61576,10 +61622,10 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FaColName) } n = nResColumn * int32(COLNAME_N) - v1 = uint16(nResColumn) + v1 = uint16(uint16(nResColumn)) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*uint64(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*uint64(uint64(n)))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -62339,7 +62385,7 @@ func _sqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, _ = pAux for *(*uintptr)(unsafe.Pointer(pp)) != 0 { pAux = *(*uintptr)(unsafe.Pointer(pp)) - if iOp < 0 || (*TAuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp && (*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 && ((*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg > int32(31) || !(uint32(mask)&(libc.Uint32FromInt32(1)<<(*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) { + if iOp < 0 || (*TAuxData)(unsafe.Pointer(pAux)).FiAuxOp == iOp && (*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg >= 0 && ((*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg > int32(31) || !(uint32(uint32(mask))&(libc.Uint32FromInt32(1)<<(*TAuxData)(unsafe.Pointer(pAux)).FiAuxArg) != 0)) { if (*TAuxData)(unsafe.Pointer(pAux)).FxDeleteAux != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAuxData)(unsafe.Pointer(pAux)).FxDeleteAux})))(tls, (*TAuxData)(unsafe.Pointer(pAux)).FpAux) } @@ -62724,7 +62770,7 @@ func _serialGet(tls *libc.TLS, buf uintptr, serial_type Tu32, pMem uintptr) { _, _ = y, v1 *(*Tu64)(unsafe.Pointer(bp)) = uint64(uint32(*(*uint8)(unsafe.Pointer(buf)))< uint32(nKey) && u != 0 { + if d > uint32(uint32(nKey)) && u != 0 { /* In a corrupt record entry, the last pMem might have been set up using ** uninitialized memory. Overwrite its value with NULL, to prevent ** warnings from MSAN. */ @@ -63065,7 +63111,7 @@ func _sqlite3IntFloatCompare(tls *libc.TLS, i Ti64, r float64) (r1 int32) { return int32(1) } if _sqlite3Config.FbUseLongDouble != 0 { - x = float64(i) + x = float64(float64(i)) if x < r { v1 = -int32(1) } else { @@ -63079,14 +63125,14 @@ func _sqlite3IntFloatCompare(tls *libc.TLS, i Ti64, r float64) (r1 int32) { if r >= float64(9.223372036854776e+18) { return -int32(1) } - y = int64(r) + y = int64(int64(r)) if i < y { return -int32(1) } if i > y { return +libc.Int32FromInt32(1) } - s = float64(i) + s = float64(float64(i)) if s < r { v2 = -int32(1) } else { @@ -63291,7 +63337,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr d1 = *(*Tu32)(unsafe.Pointer(bp)) i = 0 } - if d1 > uint32(nKey1) { + if d1 > uint32(uint32(nKey1)) { (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89131))) return 0 /* Corruption */ } @@ -63377,7 +63423,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr rc = +libc.Int32FromInt32(1) } else { (*(*TMem)(unsafe.Pointer(bp + 8))).Fn = int32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) - if v5 = d1+uint32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) > uint32(nKey1); !v5 { + if v5 = d1+uint32((*(*TMem)(unsafe.Pointer(bp + 8))).Fn) > uint32(uint32(nKey1)); !v5 { v4 = (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo pKeyInfo = v4 } @@ -63398,7 +63444,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr v6 = (*TMem)(unsafe.Pointer(pRhs)).Fn } nCmp = v6 - rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp)) + rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint64(uint64(nCmp))) if rc == 0 { rc = (*(*TMem)(unsafe.Pointer(bp + 8))).Fn - (*TMem)(unsafe.Pointer(pRhs)).Fn } @@ -63416,7 +63462,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr rc = -int32(1) } else { nStr = int32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) - if d1+uint32(nStr) > uint32(nKey1) { + if d1+uint32(uint32(nStr)) > uint32(uint32(nKey1)) { (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89242))) return 0 /* Corruption */ } else { @@ -63433,7 +63479,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr v7 = (*TMem)(unsafe.Pointer(pRhs)).Fn } nCmp1 = v7 - rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp1)) + rc = libc.Xmemcmp(tls, aKey1+uintptr(d1), (*TMem)(unsafe.Pointer(pRhs)).Fz, uint64(uint64(nCmp1))) if rc == 0 { rc = nStr - (*TMem)(unsafe.Pointer(pRhs)).Fn } @@ -63466,7 +63512,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } pRhs += 56 d1 += _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 68))) - if d1 > uint32(nKey1) { + if d1 > uint32(uint32(nKey1)) { break } idx1 += uint32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) @@ -63585,6 +63631,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -63611,7 +63658,7 @@ vrcs_restart: v1 = nStr } nCmp = v1 - res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), *(*uintptr)(unsafe.Pointer(pPKey2 + 16)), uint64(nCmp)) + res = libc.Xmemcmp(tls, aKey1+uintptr(szHdr), *(*uintptr)(unsafe.Pointer(pPKey2 + 16)), uint64(uint64(nCmp))) if res > 0 { res = int32((*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2) } else { @@ -63718,7 +63765,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr nCellKey = int64(_sqlite3BtreePayloadSize(tls, pCur)) /* Read in the complete content of the index entry */ _sqlite3VdbeMemInit(tls, bp+8, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp+8) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(uint32(nCellKey)), bp+8) if rc != 0 { return rc } @@ -63750,6 +63797,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -63787,7 +63835,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked return _sqlite3CorruptError(tls, int32(89647)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(uint32(nCellKey)), bp) if rc != 0 { return rc } @@ -64517,7 +64565,7 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(int64(n)), enc, xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64556,7 +64604,7 @@ func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u if n > uint64(0x7fffffff) { _invokeValueDestructor(tls, z, xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, int32(int32(n)), uint8(0), xDel) } } @@ -64566,16 +64614,16 @@ func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_ERROR) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF8), uintptr(-libc.Int32FromInt32(1))) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(int64(n)), uint8(SQLITE_UTF8), uintptr(-libc.Int32FromInt32(1))) } func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_ERROR) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(n), uint8(SQLITE_UTF16LE), uintptr(-libc.Int32FromInt32(1))) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, int64(int64(n)), uint8(SQLITE_UTF16LE), uintptr(-libc.Int32FromInt32(1))) } func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { - _sqlite3VdbeMemSetInt64(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int64(iVal)) + _sqlite3VdbeMemSetInt64(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int64(int64(iVal))) } func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal Ti64) { @@ -64609,8 +64657,8 @@ func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel } func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { - if int32(enc) != int32(SQLITE_UTF8) { - if int32(enc) == int32(SQLITE_UTF16) { + if int32(int32(enc)) != int32(SQLITE_UTF8) { + if int32(int32(enc)) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } n &= ^libc.Uint64FromInt32(1) @@ -64618,21 +64666,21 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u if n > uint64(0x7fffffff) { _invokeValueDestructor(tls, z, xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, int32(int32(n)), enc, xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) + _setResultStrOrError(tls, pCtx, z, int32(uint64(uint64(n)) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) + _setResultStrOrError(tls, pCtx, z, int32(uint64(uint64(n)) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) } func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) + _setResultStrOrError(tls, pCtx, z, int32(uint64(uint64(n)) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64665,7 +64713,7 @@ func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n Tu64) (r int32) { Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } - _sqlite3VdbeMemSetZeroBlob(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n)) + _sqlite3VdbeMemSetZeroBlob(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(int32(n))) return SQLITE_OK } @@ -64767,6 +64815,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -64864,6 +64913,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -65036,7 +65086,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 if rc == SQLITE_OK { /* Raw content of current row */ libc.Xmemset(tls, bp+8, 0, uint64(56)) sz = _sqlite3BtreePayloadSize(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr, uint32(int32(sz)), bp+8) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, (*TValueList)(unsafe.Pointer(pRhs)).FpCsr, uint32(int32(int32(sz))), bp+8) if rc == SQLITE_OK { zBuf = (*(*TMem)(unsafe.Pointer(bp + 8))).Fz pOut = (*TValueList)(unsafe.Pointer(pRhs)).FpOut @@ -65130,7 +65180,7 @@ func _createAggContext(tls *libc.TLS, p uintptr, nByte int32) (r uintptr) { (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Agg) *(*uintptr)(unsafe.Pointer(pMem)) = (*Tsqlite3_context)(unsafe.Pointer(p)).FpFunc if (*TMem)(unsafe.Pointer(pMem)).Fz != 0 { - libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte)) + libc.Xmemset(tls, (*TMem)(unsafe.Pointer(pMem)).Fz, 0, uint64(uint64(nByte))) } } return (*TMem)(unsafe.Pointer(pMem)).Fz @@ -65239,6 +65289,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -65616,11 +65667,12 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType /* A malloc may have failed inside of the _text() call. If this ** is the case, clear the mallocFailed flag and return NULL. */ - if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) > int32(prior_mallocFailed) { + if int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) > int32(int32(prior_mallocFailed)) { _sqlite3OomClear(tls, db) ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65785,7 +65837,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) - if rc == SQLITE_OK && int32(encoding) != 0 { + if rc == SQLITE_OK && int32(int32(encoding)) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, int32((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } if rc != 0 { @@ -65808,11 +65860,11 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, // ** Bind a blob value to an SQL statement variable. // */ func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) + return _bindText(tls, pStmt, i, zData, int64(int64(nData)), xDel, uint8(0)) } func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) + return _bindText(tls, pStmt, i, zData, int64(int64(nData)), xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65829,7 +65881,7 @@ func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) } func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) (r int32) { - return Xsqlite3_bind_int64(tls, p, i, int64(iValue)) + return Xsqlite3_bind_int64(tls, p, i, int64(int64(iValue))) } func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Tsqlite_int64) (r int32) { @@ -65875,21 +65927,21 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, } func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) + return _bindText(tls, pStmt, i, zData, int64(int64(nData)), xDel, uint8(SQLITE_UTF8)) } func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { - if int32(enc) != int32(SQLITE_UTF8) { - if int32(enc) == int32(SQLITE_UTF16) { + if int32(int32(enc)) != int32(SQLITE_UTF8) { + if int32(int32(enc)) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } nData &= uint64(^int32(libc.Uint16FromInt32(1))) } - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, int64(int64(nData)), xDel, enc) } func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) + return _bindText(tls, pStmt, i, zData, int64(uint64(uint64(n)) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -65943,7 +65995,7 @@ func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Tsqlite3_ if n > uint64(*(*int32)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb + 136))) { rc = int32(SQLITE_TOOBIG) } else { - rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, int32(n)) + rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, int32(int32(n))) } rc = _sqlite3ApiExit(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) @@ -66141,10 +66193,10 @@ func Xsqlite3_stmt_explain(tls *libc.TLS, pStmt uintptr, eMode int32) (r int32) } else { if (*TVdbe)(unsafe.Pointer(v)).FnMem >= int32(10) && (eMode != int32(2) || int32(Tbft(*(*uint16)(unsafe.Pointer(v + 200))&0x100>>8)) != 0) { /* No reprepare necessary */ - libc.SetBitFieldPtr16Uint32(v+200, uint32(eMode), 2, 0xc) + libc.SetBitFieldPtr16Uint32(v+200, uint32(uint32(eMode)), 2, 0xc) rc = SQLITE_OK } else { - libc.SetBitFieldPtr16Uint32(v+200, uint32(eMode), 2, 0xc) + libc.SetBitFieldPtr16Uint32(v+200, uint32(uint32(eMode)), 2, 0xc) rc = _sqlite3Reprepare(tls, v) libc.SetBitFieldPtr16Uint32(v+200, libc.BoolUint32(eMode == libc.Int32FromInt32(2)), 8, 0x100) } @@ -66305,7 +66357,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(int16(iIdx)))) } if iIdx >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0 { rc = int32(SQLITE_RANGE) @@ -66314,13 +66366,13 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* If the old.* record has not yet been loaded into memory, do so now. */ if (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0) { nRec = _sqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48))) - aRec = _sqlite3DbMallocRaw(tls, db, uint64(nRec)) + aRec = _sqlite3DbMallocRaw(tls, db, uint64(uint64(nRec))) if !(aRec != 0) { goto preupdate_old_out } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, int32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, int32(int32(nRec)), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66347,6 +66399,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -66434,7 +66487,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(int16(iIdx)))) } if iIdx >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0 { rc = int32(SQLITE_RANGE) @@ -66477,7 +66530,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*uint64((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*uint64((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66496,6 +66549,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -66604,7 +66658,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } } Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5550, int32(3)) - Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) + Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(int64(zRawSql))-int64(int64(zStart)))) } } else { if int32((*TVdbe)(unsafe.Pointer(p)).FnVar) == 0 { @@ -66645,7 +66699,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - if int32(enc) != int32(SQLITE_UTF8) { + if int32(int32(enc)) != int32(SQLITE_UTF8) { libc.Xmemset(tls, bp+40, 0, uint64(56)) (*(*TMem)(unsafe.Pointer(bp + 40))).Fdb = db _sqlite3VdbeMemSetStr(tls, bp+40, (*TMem)(unsafe.Pointer(pVar)).Fz, int64((*TMem)(unsafe.Pointer(pVar)).Fn), enc, libc.UintptrFromInt32(0)) @@ -66657,7 +66711,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5554, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) - if int32(enc) != int32(SQLITE_UTF8) { + if int32(int32(enc)) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { @@ -66865,12 +66919,12 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) - if int32(eCurType) == CURTYPE_BTREE { + if int32(int32(eCurType)) == CURTYPE_BTREE { v2 = _sqlite3BtreeCursorSize(tls) } else { v2 = 0 } - nByte = int32(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(nField) + uint64(v2)) + nByte = int32(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(uint64(nField)) + uint64(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -66883,7 +66937,7 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) + v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(uint64(nByte))) (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 (*TMem)(unsafe.Pointer(pMem)).Fz = v3 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { @@ -66897,10 +66951,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType - (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) + (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(int16(nField)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 - if int32(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(nField)) + if int32(int32(eCurType)) == CURTYPE_BTREE { + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(uint64(nField))) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67002,20 +67056,20 @@ func _applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { func _applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc Tu8) { var p1 uintptr _ = p1 - if int32(affinity) >= int32(SQLITE_AFF_NUMERIC) { + if int32(int32(affinity)) >= int32(SQLITE_AFF_NUMERIC) { if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Int) == 0 { /*OPTIMIZATION-IF-FALSE*/ if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&(libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) == 0 { if int32((*TMem)(unsafe.Pointer(pRec)).Fflags)&int32(MEM_Str) != 0 { _applyNumericAffinity(tls, pRec, int32(1)) } } else { - if int32(affinity) <= int32(SQLITE_AFF_REAL) { + if int32(int32(affinity)) <= int32(SQLITE_AFF_REAL) { _sqlite3VdbeIntegerAffinity(tls, pRec) } } } } else { - if int32(affinity) == int32(SQLITE_AFF_TEXT) { + if int32(int32(affinity)) == int32(SQLITE_AFF_TEXT) { /* Only attempt the conversion to TEXT if there is an integer or real ** representation (blob and NULL do not get converted) but no string ** representation. It would be harmless to repeat the conversion if @@ -67060,7 +67114,7 @@ func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) (r int32) { // ** not the internal Mem* type. // */ func _sqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity Tu8, enc Tu8) { - _applyAffinity(tls, pVal, int8(affinity), enc) + _applyAffinity(tls, pVal, int8(int8(affinity)), enc) } // C documentation @@ -67201,7 +67255,7 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf _, _, _, _, _, _, _, _, _, _ = db, encoding, len1, pBuf, pCache, rc, v1, p2, p3, p4 db = (*TMem)(unsafe.Pointer(pDest)).Fdb encoding = int32((*TMem)(unsafe.Pointer(pDest)).Fenc) - len1 = int32(_sqlite3VdbeSerialTypeLen(tls, uint32(t))) + len1 = int32(_sqlite3VdbeSerialTypeLen(tls, uint32(uint32(t)))) if len1 > *(*int32)(unsafe.Pointer(db + 136)) { return int32(SQLITE_TOOBIG) } @@ -67224,7 +67278,7 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf if pBuf == uintptr(0) { return int32(SQLITE_NOMEM) } - rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer(pC + 48)), uint32(iOffset), uint32(len1), pBuf) + rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer(pC + 48)), uint32(uint32(iOffset)), uint32(uint32(len1)), pBuf) if rc != 0 { return rc } @@ -67240,18 +67294,18 @@ func _vdbeColumnFromOverflow(tls *libc.TLS, pC uintptr, iCol int32, t int32, iOf } _sqlite3RCStrRef(tls, pBuf) if t&int32(1) != 0 { - rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(len1), uint8(encoding), __ccgo_fp(_sqlite3RCStrUnref)) + rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(int64(len1)), uint8(uint8(encoding)), __ccgo_fp(_sqlite3RCStrUnref)) p2 = pDest + 20 *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(MEM_Term)) } else { - rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(len1), uint8(0), __ccgo_fp(_sqlite3RCStrUnref)) + rc = _sqlite3VdbeMemSetStr(tls, pDest, pBuf, int64(int64(len1)), uint8(0), __ccgo_fp(_sqlite3RCStrUnref)) } } else { - rc = _sqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(pC + 48)), uint32(iOffset), uint32(len1), pDest) + rc = _sqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(pC + 48)), uint32(uint32(iOffset)), uint32(uint32(len1)), pDest) if rc != 0 { return rc } - _sqlite3VdbeSerialGet(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, uint32(t), pDest) + _sqlite3VdbeSerialGet(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, uint32(uint32(t)), pDest) if t&int32(1) != 0 && encoding == int32(SQLITE_UTF8) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1))) = 0 p3 = pDest + 20 @@ -67820,6 +67874,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -67833,6 +67888,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -67862,7 +67918,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump */ pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*56 (*TMem)(unsafe.Pointer(pIn1)).Fflags = uint16(MEM_Int) - *(*Ti64)(unsafe.Pointer(pIn1)) = int64(int32((int64(pOp) - int64(aOp)) / 24)) + *(*Ti64)(unsafe.Pointer(pIn1)) = int64(int32((int64(int64(pOp)) - int64(int64(aOp))) / 24)) goto jump_to_p2_and_check_for_interrupt /* Opcode: Return P1 P2 P3 * * ** @@ -67919,6 +67975,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -67958,7 +68015,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn1 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*56 (*TMem)(unsafe.Pointer(pIn1)).Fflags = uint16(MEM_Int) pcDest = int32(*(*Ti64)(unsafe.Pointer(pIn1))) - *(*Ti64)(unsafe.Pointer(pIn1)) = int64(int32((int64(pOp) - int64(aOp)) / 24)) + *(*Ti64)(unsafe.Pointer(pIn1)) = int64(int32((int64(int64(pOp)) - int64(int64(aOp))) / 24)) pOp = aOp + uintptr(pcDest)*24 goto _187 /* Opcode: HaltIfNull P1 P2 P3 P4 P5 @@ -68041,7 +68098,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { _sqlite3VdbeError(tls, p, __ccgo_ts+3799, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } - pcx = int32((int64(pOp) - int64(aOp)) / 24) + pcx = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5646, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) } rc = _sqlite3VdbeHalt(tls, p) @@ -68101,12 +68158,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* same as TK_STRING, out2 */ pOut = _out2Prerelease(tls, p, pOp) (*TOp)(unsafe.Pointer(pOp)).Fp1 = _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16))) - if int32(encoding) != int32(SQLITE_UTF8) { + if int32(int32(encoding)) != int32(SQLITE_UTF8) { rc = _sqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16)), int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) if rc != 0 { goto too_big } - if SQLITE_OK != _sqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) { + if SQLITE_OK != _sqlite3VdbeChangeEncoding(tls, pOut, int32(int32(encoding))) { goto no_mem } (*TMem)(unsafe.Pointer(pOut)).FszMalloc = 0 @@ -68397,7 +68454,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_ROW) != 0 { (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_ROW), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) } - (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp)-int64(aOp))/24) + int32(1) + (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(int64(pOp))-int64(int64(aOp)))/24) + int32(1) rc = int32(SQLITE_ROW) goto vdbe_return /* Opcode: Concat P1 P2 P3 * * @@ -68419,17 +68476,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*56 pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 flags1 = (*TMem)(unsafe.Pointer(pIn1)).Fflags - if (int32(flags1)|int32((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { + if (int32(int32(flags1))|int32((*TMem)(unsafe.Pointer(pIn2)).Fflags))&int32(MEM_Null) != 0 { _sqlite3VdbeMemSetNull(tls, pOut) goto _187 } - if int32(flags1)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { + if int32(int32(flags1))&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { if _sqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0 { goto no_mem } flags1 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } else { - if int32(flags1)&int32(MEM_Zero) != 0 { + if int32(int32(flags1))&int32(MEM_Zero) != 0 { if _sqlite3VdbeMemExpandBlob(tls, pIn1) != 0 { goto no_mem } @@ -68437,13 +68494,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } flags2 = (*TMem)(unsafe.Pointer(pIn2)).Fflags - if int32(flags2)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { + if int32(int32(flags2))&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) == 0 { if _sqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0 { goto no_mem } flags2 = uint16(int32((*TMem)(unsafe.Pointer(pIn2)).Fflags) & ^libc.Int32FromInt32(MEM_Str)) } else { - if int32(flags2)&int32(MEM_Zero) != 0 { + if int32(int32(flags2))&int32(MEM_Zero) != 0 { if _sqlite3VdbeMemExpandBlob(tls, pIn2) != 0 { goto no_mem } @@ -68454,7 +68511,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if nByte > int64(*(*int32)(unsafe.Pointer(db + 136))) { goto too_big } - if _sqlite3VdbeMemGrow(tls, pOut, int32(nByte)+int32(2), libc.BoolInt32(pOut == pIn2)) != 0 { + if _sqlite3VdbeMemGrow(tls, pOut, int32(int32(nByte))+int32(2), libc.BoolInt32(pOut == pIn2)) != 0 { goto no_mem } (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Str)) @@ -68464,14 +68521,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pOut)).Fz+uintptr((*TMem)(unsafe.Pointer(pIn2)).Fn), (*TMem)(unsafe.Pointer(pIn1)).Fz, uint64((*TMem)(unsafe.Pointer(pIn1)).Fn)) (*TMem)(unsafe.Pointer(pIn1)).Fflags = flags1 - if int32(encoding) > int32(SQLITE_UTF8) { + if int32(int32(encoding)) > int32(SQLITE_UTF8) { nByte &= int64(^libc.Int32FromInt32(1)) } *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte))) = 0 *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte+int64(1)))) = 0 p199 = pOut + 20 *(*Tu16)(unsafe.Pointer(p199)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p199))) | libc.Int32FromInt32(MEM_Term)) - (*TMem)(unsafe.Pointer(pOut)).Fn = int32(nByte) + (*TMem)(unsafe.Pointer(pOut)).Fn = int32(int32(nByte)) (*TMem)(unsafe.Pointer(pOut)).Fenc = encoding goto _187 /* Opcode: Add P1 P2 P3 * * @@ -68527,9 +68584,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pIn2 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2)*56 type2 = (*TMem)(unsafe.Pointer(pIn2)).Fflags pOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 - if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { + if !(int32(int32(type1))&int32(int32(type2))&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -68570,7 +68628,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto _201 _200: ; - if !((int32(type1)|int32(type2))&int32(MEM_Null) != 0) { + if !((int32(int32(type1))|int32(int32(type2)))&int32(MEM_Null) != 0) { goto _202 } goto arithmetic_result_is_null @@ -68579,9 +68637,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; type1 = _numericType(tls, pIn1) type2 = _numericType(tls, pIn2) - if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { + if int32(int32(type1))&int32(int32(type2))&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -68621,6 +68680,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -68694,16 +68754,16 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(bp + 8)) = _sqlite3VdbeIntValue(tls, pIn2) iB1 = _sqlite3VdbeIntValue(tls, pIn1) op = (*TOp)(unsafe.Pointer(pOp)).Fopcode - if int32(op) == int32(OP_BitAnd) { + if int32(int32(op)) == int32(OP_BitAnd) { *(*Ti64)(unsafe.Pointer(bp + 8)) &= iB1 } else { - if int32(op) == int32(OP_BitOr) { + if int32(int32(op)) == int32(OP_BitOr) { *(*Ti64)(unsafe.Pointer(bp + 8)) |= iB1 } else { if iB1 != 0 { /* If shifting by a negative amount, shift in the other direction */ if iB1 < 0 { - op = uint8(libc.Int32FromInt32(2)*libc.Int32FromInt32(OP_ShiftLeft) + libc.Int32FromInt32(1) - int32(op)) + op = uint8(libc.Int32FromInt32(2)*libc.Int32FromInt32(OP_ShiftLeft) + libc.Int32FromInt32(1) - int32(int32(op))) if iB1 > int64(-libc.Int32FromInt32(64)) { v204 = -iB1 } else { @@ -68712,7 +68772,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { iB1 = v204 } if iB1 >= int64(64) { - if *(*Ti64)(unsafe.Pointer(bp + 8)) >= 0 || int32(op) == int32(OP_ShiftLeft) { + if *(*Ti64)(unsafe.Pointer(bp + 8)) >= 0 || int32(int32(op)) == int32(OP_ShiftLeft) { v205 = 0 } else { v205 = -int32(1) @@ -68720,10 +68780,10 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(bp + 8)) = int64(v205) } else { libc.Xmemcpy(tls, bp+16, bp+8, uint64(8)) - if int32(op) == int32(OP_ShiftLeft) { - *(*Tu64)(unsafe.Pointer(bp + 16)) <<= uint64(iB1) + if int32(int32(op)) == int32(OP_ShiftLeft) { + *(*Tu64)(unsafe.Pointer(bp + 16)) <<= uint64(uint64(iB1)) } else { - *(*Tu64)(unsafe.Pointer(bp + 16)) >>= uint64(iB1) + *(*Tu64)(unsafe.Pointer(bp + 16)) >>= uint64(uint64(iB1)) /* Sign-extend on a right shift of a negative number */ if *(*Ti64)(unsafe.Pointer(bp + 8)) < 0 { *(*Tu64)(unsafe.Pointer(bp + 16)) |= (libc.Uint64FromUint32(0xffffffff)< *(*Ti64)(unsafe.Pointer(pIn1)) { if *(*uint8)(unsafe.Pointer(_sqlite3aGTb + uintptr((*TOp)(unsafe.Pointer(pOp)).Fopcode))) != 0 { @@ -68952,17 +69012,17 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } goto _187 } - if (int32(flags11)|int32(flags3))&int32(MEM_Null) != 0 { + if (int32(int32(flags11))|int32(int32(flags3)))&int32(MEM_Null) != 0 { /* One or both operands are NULL */ if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(SQLITE_NULLEQ) != 0 { /* If SQLITE_NULLEQ is set (which will only happen if the operator is ** OP_Eq or OP_Ne) then take the jump or not depending on whether ** or not both operands are null. */ - if int32(flags11)&int32(flags3)&int32(MEM_Null) != 0 && int32(flags3)&int32(MEM_Cleared) == 0 { + if int32(int32(flags11))&int32(int32(flags3))&int32(MEM_Null) != 0 && int32(int32(flags3))&int32(MEM_Cleared) == 0 { res = 0 /* Operands are equal */ } else { - if int32(flags3)&int32(MEM_Null) != 0 { + if int32(int32(flags3))&int32(MEM_Null) != 0 { v207 = -int32(1) } else { v207 = +libc.Int32FromInt32(1) @@ -68984,37 +69044,37 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* Neither operand is NULL and we couldn't do the special high-speed ** integer comparison case. So do a general-case comparison. */ affinity = int8(int32((*TOp)(unsafe.Pointer(pOp)).Fp5) & int32(SQLITE_AFF_MASK)) - if int32(affinity) >= int32(SQLITE_AFF_NUMERIC) { - if (int32(flags11)|int32(flags3))&int32(MEM_Str) != 0 { - if int32(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if int32(int32(affinity)) >= int32(SQLITE_AFF_NUMERIC) { + if (int32(int32(flags11))|int32(int32(flags3)))&int32(MEM_Str) != 0 { + if int32(int32(flags11))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn1, 0) flags3 = (*TMem)(unsafe.Pointer(pIn3)).Fflags } - if int32(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if int32(int32(flags3))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn3, 0) } } } else { - if int32(affinity) == int32(SQLITE_AFF_TEXT) && (int32(flags11)|int32(flags3))&int32(MEM_Str) != 0 { - if int32(flags11)&int32(MEM_Str) != 0 { + if int32(int32(affinity)) == int32(SQLITE_AFF_TEXT) && (int32(int32(flags11))|int32(int32(flags3)))&int32(MEM_Str) != 0 { + if int32(int32(flags11))&int32(MEM_Str) != 0 { p208 = pIn1 + 20 *(*Tu16)(unsafe.Pointer(p208)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p208))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } else { - if int32(flags11)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if int32(int32(flags11))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1)) - flags11 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(flags11)&int32(MEM_TypeMask)) + flags11 = uint16(int32((*TMem)(unsafe.Pointer(pIn1)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(int32(flags11))&int32(MEM_TypeMask)) if pIn1 == pIn3 { - flags3 = uint16(int32(flags11) | int32(MEM_Str)) + flags3 = uint16(int32(int32(flags11)) | int32(MEM_Str)) } } } - if int32(flags3)&int32(MEM_Str) != 0 { + if int32(int32(flags3))&int32(MEM_Str) != 0 { p209 = pIn3 + 20 *(*Tu16)(unsafe.Pointer(p209)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p209))) & ^(libc.Int32FromInt32(MEM_Int) | libc.Int32FromInt32(MEM_Real) | libc.Int32FromInt32(MEM_IntReal))) } else { - if int32(flags3)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { + if int32(int32(flags3))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)) != 0 { _sqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1)) - flags3 = uint16(int32((*TMem)(unsafe.Pointer(pIn3)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(flags3)&int32(MEM_TypeMask)) + flags3 = uint16(int32((*TMem)(unsafe.Pointer(pIn3)).Fflags) & ^libc.Int32FromInt32(MEM_TypeMask) | int32(int32(flags3))&int32(MEM_TypeMask)) } } } @@ -69117,14 +69177,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if aPermute != 0 { v211 = *(*Tu32)(unsafe.Pointer(aPermute + uintptr(i)*4)) } else { - v211 = uint32(i) + v211 = uint32(uint32(i)) } idx = v211 pColl = *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) bRev = int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i)))) & int32(KEYINFO_ORDER_DESC) - iCompare = _sqlite3MemCompare(tls, aMem+uintptr(uint32(p11)+idx)*56, aMem+uintptr(uint32(p21)+idx)*56, pColl) + iCompare = _sqlite3MemCompare(tls, aMem+uintptr(uint32(uint32(p11))+idx)*56, aMem+uintptr(uint32(uint32(p21))+idx)*56, pColl) if iCompare != 0 { - if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i))))&int32(KEYINFO_ORDER_BIGNULL) != 0 && (int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(p11)+idx)*56))).Fflags)&int32(MEM_Null) != 0 || int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(p21)+idx)*56))).Fflags)&int32(MEM_Null) != 0) { + if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i))))&int32(KEYINFO_ORDER_BIGNULL) != 0 && (int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(uint32(p11))+idx)*56))).Fflags)&int32(MEM_Null) != 0 || int32((*(*TMem)(unsafe.Pointer(aMem + uintptr(uint32(uint32(p21))+idx)*56))).Fflags)&int32(MEM_Null) != 0) { iCompare = -iCompare } if bRev != 0 { @@ -69193,7 +69253,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if v11 == int32(2) { (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) } else { - *(*Ti64)(unsafe.Pointer(pOut)) = int64(v11) + *(*Ti64)(unsafe.Pointer(pOut)) = int64(int64(v11)) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(int32((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Int)) } goto _187 @@ -69275,7 +69335,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _56: ; /* Address of this instruction */ if (*TVdbe)(unsafe.Pointer(p)).FpFrame != 0 { - iAddr = uint32(int32((int64(pOp) - int64((*TVdbe)(unsafe.Pointer(p)).FaOp)) / 24)) + iAddr = uint32(int32((int64(int64(pOp)) - int64((*TVdbe)(unsafe.Pointer(p)).FaOp)) / 24)) if int32(*(*Tu8)(unsafe.Pointer((*TVdbeFrame)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr(iAddr/uint32(8)))))&(int32(1)<<(iAddr&uint32(7))) != 0 { goto jump_to_p2 } @@ -69378,7 +69438,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { typeMask = uint16(int32(1) << (Xsqlite3_value_type(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56) - int32(1))) } - if int32(typeMask)&int32((*TOp)(unsafe.Pointer(pOp)).Fp5) != 0 { + if int32(int32(typeMask))&int32((*TOp)(unsafe.Pointer(pOp)).Fp5) != 0 { goto jump_to_p2 } goto _187 @@ -69488,6 +69548,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -69614,13 +69675,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) offset64 = uint64(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(i1)*4))) zHdr = zData + uintptr((*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset) zEndHdr = zData + uintptr(*(*Tu32)(unsafe.Pointer(aOffset))) - for cond := true; cond; cond = uint32(i1) <= p22 && zHdr < zEndHdr { + for cond := true; cond; cond = uint32(uint32(i1)) <= p22 && zHdr < zEndHdr { v222 = uint32(*(*Tu8)(unsafe.Pointer(zHdr))) *(*Tu32)(unsafe.Pointer(bp + 80)) = v222 v221 = v222 @@ -69653,8 +69715,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto op_column_corrupt } } - (*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = uint16(i1) - (*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = uint32(int64(zHdr) - int64(zData)) + (*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed = uint16(uint16(i1)) + (*TVdbeCursor)(unsafe.Pointer(pC3)).FiHdrOffset = uint32(int64(int64(zHdr)) - int64(int64(zData))) if (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow == uintptr(0) { _sqlite3VdbeMemRelease(tls, bp+24) } @@ -69713,7 +69775,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } else { (*TMem)(unsafe.Pointer(pDest)).Fz = (*TMem)(unsafe.Pointer(pDest)).FzMalloc } - libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len1)) + libc.Xmemcpy(tls, (*TMem)(unsafe.Pointer(pDest)).Fz, zData, uint64(uint64(len1))) *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1))) = 0 *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pDest)).Fz + uintptr(len1+int32(1)))) = 0 (*TMem)(unsafe.Pointer(pDest)).Fflags = _aFlag1[*(*Tu32)(unsafe.Pointer(bp + 80))&uint32(1)] @@ -69723,7 +69785,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* This branch happens only when content is on overflow pages */ v225 = uint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp5) & libc.Int32FromInt32(OPFLAG_BYTELENARG)) p5 = v225 - if int32(v225) != 0 && (int32(p5) == int32(OPFLAG_TYPEOFARG) || *(*Tu32)(unsafe.Pointer(bp + 80)) >= uint32(12) && (*(*Tu32)(unsafe.Pointer(bp + 80))&uint32(1) == uint32(0) || int32(p5) == int32(OPFLAG_BYTELENARG))) || _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 80))) == uint32(0) { + if int32(v225) != 0 && (int32(int32(p5)) == int32(OPFLAG_TYPEOFARG) || *(*Tu32)(unsafe.Pointer(bp + 80)) >= uint32(12) && (*(*Tu32)(unsafe.Pointer(bp + 80))&uint32(1) == uint32(0) || int32(int32(p5)) == int32(OPFLAG_BYTELENARG))) || _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp + 80))) == uint32(0) { /* Content is irrelevant for ** 1. the typeof() function, ** 2. the length(X) function if X is a blob, and @@ -69739,7 +69801,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _sqlite3VdbeSerialGet(tls, uintptr(unsafe.Pointer(&_sqlite3CtypeMap)), *(*Tu32)(unsafe.Pointer(bp + 80)), pDest) } else { - rc = _vdbeColumnFromOverflow(tls, pC3, int32(p22), int32(*(*Tu32)(unsafe.Pointer(bp + 80))), int64(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(p22)*4))), (*TVdbe)(unsafe.Pointer(p)).FcacheCtr, colCacheCtr, pDest) + rc = _vdbeColumnFromOverflow(tls, pC3, int32(int32(p22)), int32(*(*Tu32)(unsafe.Pointer(bp + 80))), int64(*(*Tu32)(unsafe.Pointer(aOffset + uintptr(p22)*4))), (*TVdbe)(unsafe.Pointer(p)).FcacheCtr, colCacheCtr, pDest) if rc != 0 { if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -69751,9 +69813,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -69860,6 +69924,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5670, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -70023,12 +70088,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if i3 < 0 { uu = uint64(^i3) } else { - uu = uint64(i3) + uu = uint64(uint64(i3)) } nHdr++ if uu <= uint64(127) { if i3&int64(1) == i3 && int32((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) >= int32(4) { - (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(8) + uint32(uu) + (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(8) + uint32(uint32(uu)) } else { nData++ (*TMem)(unsafe.Pointer(pRec)).FuTemp = uint32(1) @@ -70088,8 +70153,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { nZero += int64(*(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pRec)).Fu))) } } - nData += uint64(len11) - nHdr += _sqlite3VarintLen(tls, uint64(serial_type)) + nData += uint64(uint64(len11)) + nHdr += _sqlite3VarintLen(tls, uint64(uint64(serial_type))) (*TMem)(unsafe.Pointer(pRec)).FuTemp = serial_type } } @@ -70108,13 +70173,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { nHdr += int32(1) } else { /* Rare case of a really large header */ - nVarint = _sqlite3VarintLen(tls, uint64(nHdr)) + nVarint = _sqlite3VarintLen(tls, uint64(uint64(nHdr))) nHdr += nVarint - if nVarint < _sqlite3VarintLen(tls, uint64(nHdr)) { + if nVarint < _sqlite3VarintLen(tls, uint64(uint64(nHdr))) { nHdr++ } } - nByte1 = int64(uint64(nHdr) + nData) + nByte1 = int64(uint64(uint64(nHdr)) + nData) /* Make sure the output register has a buffer large enough to store ** the new record. The output register (pOp->p3) is not allowed to ** be one of the input registers (because the following call to @@ -70130,14 +70195,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if nByte1+nZero > int64(*(*int32)(unsafe.Pointer(db + 136))) { goto too_big } - if _sqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0 { + if _sqlite3VdbeMemClearAndResize(tls, pOut, int32(int32(nByte1))) != 0 { goto no_mem } } - (*TMem)(unsafe.Pointer(pOut)).Fn = int32(nByte1) + (*TMem)(unsafe.Pointer(pOut)).Fn = int32(int32(nByte1)) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Blob) if nZero != 0 { - *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pOut)).Fu)) = int32(nZero) + *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pOut)).Fu)) = int32(int32(nZero)) p239 = pOut + 20 *(*Tu16)(unsafe.Pointer(p239)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p239))) | libc.Int32FromInt32(MEM_Zero)) } @@ -70147,9 +70212,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if nHdr < int32(0x80) { v240 = zHdr1 zHdr1++ - *(*Tu8)(unsafe.Pointer(v240)) = uint8(nHdr) + *(*Tu8)(unsafe.Pointer(v240)) = uint8(uint8(nHdr)) } else { - zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(nHdr))) + zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(uint64(nHdr)))) } pRec = pData0 for int32(1) != 0 { @@ -70161,7 +70226,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if serial_type <= uint32(7) { v241 = zHdr1 zHdr1++ - *(*Tu8)(unsafe.Pointer(v241)) = uint8(serial_type) + *(*Tu8)(unsafe.Pointer(v241)) = uint8(uint8(serial_type)) if serial_type == uint32(0) { /* NULL value. No change in zPayload */ } else { @@ -70205,13 +70270,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if serial_type < uint32(0x80) { v242 = zHdr1 zHdr1++ - *(*Tu8)(unsafe.Pointer(v242)) = uint8(serial_type) + *(*Tu8)(unsafe.Pointer(v242)) = uint8(uint8(serial_type)) if serial_type >= uint32(14) && (*TMem)(unsafe.Pointer(pRec)).Fn > 0 { libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, uint64((*TMem)(unsafe.Pointer(pRec)).Fn)) zPayload += uintptr((*TMem)(unsafe.Pointer(pRec)).Fn) } } else { - zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(serial_type))) + zHdr1 += uintptr(_sqlite3PutVarint(tls, zHdr1, uint64(uint64(serial_type)))) if (*TMem)(unsafe.Pointer(pRec)).Fn != 0 { libc.Xmemcpy(tls, zPayload, (*TMem)(unsafe.Pointer(pRec)).Fz, uint64((*TMem)(unsafe.Pointer(pRec)).Fn)) zPayload += uintptr((*TMem)(unsafe.Pointer(pRec)).Fn) @@ -70281,7 +70346,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } /* Create a new savepoint structure. */ - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(32)+uint64(nName)+uint64(1)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(32)+uint64(uint64(nName))+uint64(1))) if pNew != 0 { (*TSavepoint)(unsafe.Pointer(pNew)).FzName = pNew + 1*32 libc.Xmemcpy(tls, (*TSavepoint)(unsafe.Pointer(pNew)).FzName, zName, uint64(nName+int32(1))) @@ -70339,7 +70404,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(1) if _sqlite3VdbeHalt(tls, p) == int32(SQLITE_BUSY) { - (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24) + (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(0) v245 = libc.Int32FromInt32(SQLITE_BUSY) rc = v245 @@ -70467,12 +70532,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if v248 != SQLITE_OK { goto vdbe_return } else { - (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(desiredAutoCommit) + (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(uint8(desiredAutoCommit)) } } } if _sqlite3VdbeHalt(tls, p) == int32(SQLITE_BUSY) { - (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24) + (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) (*Tsqlite3)(unsafe.Pointer(db)).FautoCommit = uint8(libc.Int32FromInt32(1) - desiredAutoCommit) v249 = libc.Int32FromInt32(SQLITE_BUSY) rc = v249 @@ -70556,7 +70621,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3BtreeBeginTrans(tls, pBt, (*TOp)(unsafe.Pointer(pOp)).Fp2, bp+104) if rc != SQLITE_OK { if rc&int32(0xff) == int32(SQLITE_BUSY) { - (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(pOp) - int64(aOp)) / 24) + (*TVdbe)(unsafe.Pointer(p)).Fpc = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) (*TVdbe)(unsafe.Pointer(p)).Frc = rc goto vdbe_return } @@ -70812,7 +70877,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if pCur == uintptr(0) { goto no_mem } - (*TVdbeCursor)(unsafe.Pointer(pCur)).FiDb = int8(iDb1) + (*TVdbeCursor)(unsafe.Pointer(pCur)).FiDb = int8(int8(iDb1)) (*TVdbeCursor)(unsafe.Pointer(pCur)).FnullRow = uint8(1) libc.SetBitFieldPtr8Uint32(pCur+8, libc.Uint32FromInt32(1), 2, 0x4) (*TVdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot = p23 @@ -70823,6 +70888,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -71145,7 +71211,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** the seek, so convert it. */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 flags31 = (*TMem)(unsafe.Pointer(pIn3)).Fflags - if int32(flags31)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { + if int32(int32(flags31))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_Real)|libc.Int32FromInt32(MEM_IntReal)|libc.Int32FromInt32(MEM_Str)) == int32(MEM_Str) { _applyNumericAffinity(tls, pIn3, 0) } iKey = _sqlite3VdbeIntValue(tls, pIn3) /* Get the integer key value */ @@ -71153,9 +71219,9 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TMem)(unsafe.Pointer(pIn3)).Fflags = flags31 /* But convert the type back to its original */ /* If the P3 value could not be converted into an integer without ** loss of information, then special processing is required... */ - if int32(newType)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { - if int32(newType)&int32(MEM_Real) == 0 { - if int32(newType)&int32(MEM_Null) != 0 || oc >= int32(OP_SeekGE) { + if int32(int32(newType))&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) == 0 { + if int32(int32(newType))&int32(MEM_Real) == 0 { + if int32(int32(newType))&int32(MEM_Null) != 0 || oc >= int32(OP_SeekGE) { goto jump_to_p2 } else { rc = _sqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), bp+112) @@ -71185,7 +71251,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } - rc = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), int64(uint64(iKey)), 0, bp+112) + rc = _sqlite3BtreeTableMoveto(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48)), int64(uint64(uint64(iKey))), 0, bp+112) (*TVdbeCursor)(unsafe.Pointer(pC5)).FmovetoTarget = iKey /* Used by OP_Delete */ if rc != SQLITE_OK { goto abort_due_to_error @@ -71201,7 +71267,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } nField2 = (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi (*(*TUnpackedRecord)(unsafe.Pointer(bp + 120))).FpKeyInfo = (*TVdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo - (*(*TUnpackedRecord)(unsafe.Pointer(bp + 120))).FnField = uint16(nField2) + (*(*TUnpackedRecord)(unsafe.Pointer(bp + 120))).FnField = uint16(uint16(nField2)) /* The next line of code computes as follows, only faster: ** if( oc==OP_SeekGT || oc==OP_SeekLE ){ ** r.default_rc = -1; @@ -71259,6 +71325,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -71364,6 +71431,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -71674,13 +71742,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) pCrsr2 = *(*uintptr)(unsafe.Pointer(pC10 + 48)) *(*int32)(unsafe.Pointer(bp + 248)) = 0 - rc = _sqlite3BtreeTableMoveto(tls, pCrsr2, int64(iKey1), 0, bp+248) - (*TVdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = int64(iKey1) /* Used by OP_Delete */ + rc = _sqlite3BtreeTableMoveto(tls, pCrsr2, int64(int64(iKey1)), 0, bp+248) + (*TVdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = int64(int64(iKey1)) /* Used by OP_Delete */ (*TVdbeCursor)(unsafe.Pointer(pC10)).FnullRow = uint8(0) (*TVdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = uint32(CACHE_STALE) (*TVdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = uint8(0) @@ -72302,7 +72371,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if *(*int32)(unsafe.Pointer(bp + 396)) == 0 { sz = _sqlite3BtreeRowCountEst(tls, pCrsr5) - if sz >= 0 && int32(_sqlite3LogEst(tls, uint64(sz))) < (*TOp)(unsafe.Pointer(pOp)).Fp3 { + if sz >= 0 && int32(_sqlite3LogEst(tls, uint64(uint64(sz)))) < (*TOp)(unsafe.Pointer(pOp)).Fp3 { *(*int32)(unsafe.Pointer(bp + 396)) = int32(1) } } @@ -72441,6 +72510,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -72732,7 +72802,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) - rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur2, uint32(nCellKey), bp+552) + rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur2, uint32(uint32(nCellKey)), bp+552) if rc != 0 { goto abort_due_to_error } @@ -73043,7 +73113,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeMemSetStr(tls, pIn1, *(*uintptr)(unsafe.Pointer(bp + 688)), int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp(Xsqlite3_free)) } } - _sqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pIn1, int32(int32(encoding))) goto check_for_interrupt /* Opcode: RowSetAdd P1 P2 * * * ** Synopsis: rowset(P1)=r[P2] @@ -73195,8 +73265,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = int32((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + uint64(nMem)*uint64(56) + uint64((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + uint64(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, uint64(nByte2)) + nByte2 = int32((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + uint64(uint64(nMem))*uint64(56) + uint64((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + uint64(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte2))) if !(pFrame2 != 0) { goto no_mem } @@ -73208,7 +73278,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr = (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr - (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = int32((int64(pOp) - int64(aOp)) / 24) + (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FaMem = (*TVdbe)(unsafe.Pointer(p)).FaMem (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnMem = (*TVdbe)(unsafe.Pointer(p)).FnMem (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FapCsr = (*TVdbe)(unsafe.Pointer(p)).FapCsr @@ -73493,7 +73563,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _151: ; n4 = int32((*TOp)(unsafe.Pointer(pOp)).Fp5) - pCtx = _sqlite3DbMallocRawNN(tls, db, uint64(n4)*uint64(8)+(libc.Uint64FromInt64(56)+libc.Uint64FromInt64(56)-libc.Uint64FromInt64(8))) + pCtx = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(uint64(n4))*uint64(8)+(libc.Uint64FromInt64(56)+libc.Uint64FromInt64(56)-libc.Uint64FromInt64(8)))) if pCtx == uintptr(0) { goto no_mem } @@ -73501,12 +73571,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut = pCtx + 48 + uintptr(n4)*8 _sqlite3VdbeMemInit(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16)) - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = int32((int64(pOp) - int64(aOp)) / 24) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = int32((int64(int64(pOp)) - int64(int64(aOp))) / 24) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = uint8(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc = encoding - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(n4) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = uint8(uint8(n4)) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(15)) *(*uintptr)(unsafe.Pointer(pOp + 16)) = pCtx /* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */ @@ -73600,7 +73670,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeError(tls, p, __ccgo_ts+3799, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } - _sqlite3VdbeChangeEncoding(tls, pMem3, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pMem3, int32(int32(encoding))) goto _187 /* Opcode: Checkpoint P1 P2 P3 * * ** @@ -73721,7 +73791,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TMem)(unsafe.Pointer(pOut)).Fz = _sqlite3JournalModename(tls, eNew) (*TMem)(unsafe.Pointer(pOut)).Fn = _sqlite3Strlen30(tls, (*TMem)(unsafe.Pointer(pOut)).Fz) (*TMem)(unsafe.Pointer(pOut)).Fenc = uint8(SQLITE_UTF8) - _sqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pOut, int32(int32(encoding))) if rc != 0 { goto abort_due_to_error } @@ -74094,7 +74164,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeError(tls, p, __ccgo_ts+3799, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } - _sqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) + _sqlite3VdbeChangeEncoding(tls, pDest2, int32(int32(encoding))) if rc != 0 { goto abort_due_to_error } @@ -74561,6 +74631,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -74575,7 +74646,7 @@ abort_due_to_error: } (*TVdbe)(unsafe.Pointer(p)).Frc = rc _sqlite3SystemError(tls, db, rc) - Xsqlite3_log(tls, rc, __ccgo_ts+6273, libc.VaList(bp+944, int32((int64(pOp)-int64(aOp))/24), (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, rc, __ccgo_ts+6273, libc.VaList(bp+944, int32((int64(int64(pOp))-int64(int64(aOp)))/24), (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { _sqlite3VdbeHalt(tls, p) } @@ -74586,12 +74657,13 @@ abort_due_to_error: *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Int32FromInt32(0x00002)) << libc.Int32FromInt32(32) } rc = int32(SQLITE_ERROR) - if int32(resetSchemaOnFault) > 0 { - _sqlite3ResetOneSchema(tls, db, int32(resetSchemaOnFault)-int32(1)) + if int32(int32(resetSchemaOnFault)) > 0 { + _sqlite3ResetOneSchema(tls, db, int32(int32(resetSchemaOnFault))-int32(1)) } /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -74602,7 +74674,7 @@ vdbe_return: goto abort_due_to_error } } - *(*Tu32)(unsafe.Pointer(p + 212 + 4*4)) += uint32(int32(nVmStep)) + *(*Tu32)(unsafe.Pointer(p + 212 + 4*4)) += uint32(int32(int32(nVmStep))) if (*TVdbe)(unsafe.Pointer(p)).FlockMask != uint32(0) { _sqlite3VdbeLeave(tls, p) } @@ -74610,6 +74682,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5427, 0) @@ -74617,6 +74690,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -74626,6 +74700,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -75007,7 +75082,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, _sqlite3VdbeMakeReady(tls, v, bp+8) } } - (*TIncrblob)(unsafe.Pointer(pBlob)).FiCol = uint16(iCol) + (*TIncrblob)(unsafe.Pointer(pBlob)).FiCol = uint16(uint16(iCol)) (*TIncrblob)(unsafe.Pointer(pBlob)).Fdb = db _sqlite3BtreeLeaveAll(tls, db) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -75021,6 +75096,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -75127,7 +75203,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) v = (*TIncrblob)(unsafe.Pointer(p)).FpStmt - if n < 0 || iOffset < 0 || int64(iOffset)+int64(n) > int64((*TIncrblob)(unsafe.Pointer(p)).FnByte) { + if n < 0 || iOffset < 0 || int64(int64(iOffset))+int64(int64(n)) > int64((*TIncrblob)(unsafe.Pointer(p)).FnByte) { /* Request is out of range. Return a transient error. */ rc = int32(SQLITE_ERROR) } else { @@ -75145,7 +75221,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), int32((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(uint32(n)), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75842,7 +75918,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i _, _, _, _, _, _, _, _, _, _ = aNew, iBuf, nAvail, nCopy, nNew, nRead, nRem, rc, rc1, v1 /* Bytes of data available in buffer */ if (*TPmaReader)(unsafe.Pointer(p)).FaMap != 0 { *(*uintptr)(unsafe.Pointer(ppOut)) = (*TPmaReader)(unsafe.Pointer(p)).FaMap + uintptr((*TPmaReader)(unsafe.Pointer(p)).FiReadOff) - *(*Ti64)(unsafe.Pointer(p)) += int64(nByte) + *(*Ti64)(unsafe.Pointer(p)) += int64(int64(nByte)) return SQLITE_OK } /* If there is no more data to be read from the buffer, read the next @@ -75868,7 +75944,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i ** case there is no need to make a copy of the data, just return a ** pointer into the buffer to the caller. */ *(*uintptr)(unsafe.Pointer(ppOut)) = (*TPmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf) - *(*Ti64)(unsafe.Pointer(p)) += int64(nByte) + *(*Ti64)(unsafe.Pointer(p)) += int64(int64(nByte)) } else { /* Bytes remaining to copy */ /* Extend the p->aAlloc[] allocation if required. */ if (*TPmaReader)(unsafe.Pointer(p)).FnAlloc < nByte { @@ -75878,20 +75954,20 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i v1 = int64(2) * int64((*TPmaReader)(unsafe.Pointer(p)).FnAlloc) } nNew = v1 - for int64(nByte) > nNew { + for int64(int64(nByte)) > nNew { nNew = nNew * int64(2) } - aNew = _sqlite3Realloc(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, uint64(nNew)) + aNew = _sqlite3Realloc(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, uint64(uint64(nNew))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } - (*TPmaReader)(unsafe.Pointer(p)).FnAlloc = int32(nNew) + (*TPmaReader)(unsafe.Pointer(p)).FnAlloc = int32(int32(nNew)) (*TPmaReader)(unsafe.Pointer(p)).FaAlloc = aNew } /* Copy as much data as is available in the buffer into the start of ** p->aAlloc[]. */ - libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), uint64(nAvail)) - *(*Ti64)(unsafe.Pointer(p)) += int64(nAvail) + libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc, (*TPmaReader)(unsafe.Pointer(p)).FaBuffer+uintptr(iBuf), uint64(uint64(nAvail))) + *(*Ti64)(unsafe.Pointer(p)) += int64(int64(nAvail)) nRem = nByte - nAvail /* The following loop copies up to p->nBuffer bytes per iteration into ** the p->aAlloc[] buffer. */ @@ -75904,7 +75980,7 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i if rc1 != SQLITE_OK { return rc1 } - libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp)), uint64(nCopy)) + libc.Xmemcpy(tls, (*TPmaReader)(unsafe.Pointer(p)).FaAlloc+uintptr(nByte-nRem), *(*uintptr)(unsafe.Pointer(bp)), uint64(uint64(nCopy))) nRem -= nCopy } *(*uintptr)(unsafe.Pointer(ppOut)) = (*TPmaReader)(unsafe.Pointer(p)).FaAlloc @@ -75997,9 +76073,9 @@ func _vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uint rc = _vdbeSorterMapFile(tls, pTask, pFile, pReadr+64) if rc == SQLITE_OK && (*TPmaReader)(unsafe.Pointer(pReadr)).FaMap == uintptr(0) { pgsz = (*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fpgsz - iBuf = int32((*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff % int64(pgsz)) + iBuf = int32((*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff % int64(int64(pgsz))) if (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) { - (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer = _sqlite3Malloc(tls, uint64(pgsz)) + (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer = _sqlite3Malloc(tls, uint64(uint64(pgsz))) if (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -76007,7 +76083,7 @@ func _vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uint } if rc == SQLITE_OK && iBuf != 0 { nRead = pgsz - iBuf - if (*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff+int64(nRead) > (*TPmaReader)(unsafe.Pointer(pReadr)).FiEof { + if (*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff+int64(int64(nRead)) > (*TPmaReader)(unsafe.Pointer(pReadr)).FiEof { nRead = int32((*TPmaReader)(unsafe.Pointer(pReadr)).FiEof - (*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff) } rc = _sqlite3OsRead(tls, (*TPmaReader)(unsafe.Pointer(pReadr)).FpFd, (*TPmaReader)(unsafe.Pointer(pReadr)).FaBuffer+uintptr(iBuf), nRead, (*TPmaReader)(unsafe.Pointer(pReadr)).FiReadOff) @@ -76203,7 +76279,7 @@ func _vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p res = 0 i = 0 for { - if !(i < int32(n)) { + if !(i < int32(int32(n))) { break } v21 = int32(*(*Tu8)(unsafe.Pointer(v1 + uintptr(i)))) - int32(*(*Tu8)(unsafe.Pointer(v2 + uintptr(i)))) @@ -76308,7 +76384,7 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ szKeyInfo = int32(uint64(40) + uint64(int32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = int32(uint64(192) + uint64(nWorker)*uint64(96)) + sz = int32(uint64(192) + uint64(uint64(nWorker))*uint64(96)) pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo)) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { @@ -76318,10 +76394,10 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt v1 = pSorter + uintptr(sz) pKeyInfo = v1 (*TVdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = v1 - libc.Xmemcpy(tls, pKeyInfo, (*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo)) + libc.Xmemcpy(tls, pKeyInfo, (*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(uint64(szKeyInfo))) (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0) if nField != 0 && nWorker == 0 { - (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = uint16(nField) + (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = uint16(uint16(nField)) } _sqlite3BtreeEnter(tls, pBt) v2 = _sqlite3BtreeGetPageSize(tls, pBt) @@ -76346,14 +76422,14 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } if !(_sqlite3TempInMemory(tls, db) != 0) { /* Cache size in bytes*/ szPma = _sqlite3Config.FszPma - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = int32(szPma * uint32(pgsz)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize = int32(szPma * uint32(uint32(pgsz))) mxCache = int64((*TSchema)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)).Fcache_size) if mxCache < 0 { /* A negative cache-size value C indicates that the cache is abs(C) ** KiB in size. */ mxCache = mxCache * int64(-int32(1024)) } else { - mxCache = mxCache * int64(pgsz) + mxCache = mxCache * int64(int64(pgsz)) } if mxCache < int64(libc.Int32FromInt32(1)< int32(mxCache) { + if (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize > int32(int32(mxCache)) { v5 = (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize } else { - v5 = int32(mxCache) + v5 = int32(int32(mxCache)) } (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize = v5 /* Avoid large memory allocations if the application has requested ** SQLITE_CONFIG_SMALL_MALLOC. */ if int32(_sqlite3Config.FbSmallMalloc) == 0 { (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = pgsz - (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, uint64(pgsz)) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = _sqlite3Malloc(tls, uint64(uint64(pgsz))) if !((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0) { rc = int32(SQLITE_NOMEM) } @@ -76514,11 +76590,11 @@ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { for N < nReader { N += N } - nByte = int32(uint64(32) + uint64(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = int32(uint64(32) + uint64(uint64(N))*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, uint64(nByte)) + v1 = _sqlite3MallocZero(tls, uint64(uint64(nByte))) } pNew = v1 if pNew != 0 { @@ -76848,11 +76924,11 @@ func _vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStar var v1 int32 _ = v1 libc.Xmemset(tls, p, 0, uint64(48)) - (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer = _sqlite3Malloc(tls, uint64(nBuf)) + (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer = _sqlite3Malloc(tls, uint64(uint64(nBuf))) if !((*TPmaWriter)(unsafe.Pointer(p)).FaBuffer != 0) { (*TPmaWriter)(unsafe.Pointer(p)).FeFWErr = int32(SQLITE_NOMEM) } else { - v1 = int32(iStart % int64(nBuf)) + v1 = int32(iStart % int64(int64(nBuf))) (*TPmaWriter)(unsafe.Pointer(p)).FiBufStart = v1 (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd = v1 (*TPmaWriter)(unsafe.Pointer(p)).FiWriteOff = iStart - int64((*TPmaWriter)(unsafe.Pointer(p)).FiBufStart) @@ -76876,7 +76952,7 @@ func _vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { if nCopy > (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer-(*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd { nCopy = (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer - (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd } - libc.Xmemcpy(tls, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), uint64(nCopy)) + libc.Xmemcpy(tls, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd), pData+uintptr(nData-nRem), uint64(uint64(nCopy))) *(*int32)(unsafe.Pointer(p + 24)) += nCopy if (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd == (*TPmaWriter)(unsafe.Pointer(p)).FnBuffer { (*TPmaWriter)(unsafe.Pointer(p)).FeFWErr = _sqlite3OsWrite(tls, (*TPmaWriter)(unsafe.Pointer(p)).FpFd, (*TPmaWriter)(unsafe.Pointer(p)).FaBuffer+uintptr((*TPmaWriter)(unsafe.Pointer(p)).FiBufStart), (*TPmaWriter)(unsafe.Pointer(p)).FiBufEnd-(*TPmaWriter)(unsafe.Pointer(p)).FiBufStart, (*TPmaWriter)(unsafe.Pointer(p)).FiWriteOff+int64((*TPmaWriter)(unsafe.Pointer(p)).FiBufStart)) @@ -77051,14 +77127,14 @@ func _vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) (r int3 ** is sorted from oldest to newest, so pReadr1 contains older values ** than pReadr2 iff (pReadr1 int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize) { - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize = int32(nPMA) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxKeysize = int32(int32(nPMA)) } if (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 { nMin = int32(int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiMemory) + nReq) @@ -77234,16 +77310,16 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 if (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 { iListOff = int32(int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) } - for nNew < int64(nMin) { + for nNew < int64(int64(nMin)) { nNew = nNew * int64(2) } if nNew > int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) { nNew = int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) } - if nNew < int64(nMin) { - nNew = int64(nMin) + if nNew < int64(int64(nMin)) { + nNew = int64(int64(nMin)) } - aNew = _sqlite3Realloc(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory, uint64(nNew)) + aNew = _sqlite3Realloc(tls, (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory, uint64(uint64(nNew))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -77251,7 +77327,7 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = aNew + uintptr(iListOff) } (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory = aNew - (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = int32(nNew) + (*TVdbeSorter)(unsafe.Pointer(pSorter)).FnMemory = int32(int32(nNew)) } pNew = (*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory + uintptr((*TVdbeSorter)(unsafe.Pointer(pSorter)).FiMemory) p3 = pSorter + 80 @@ -77260,7 +77336,7 @@ func _sqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) (r int32 *(*int32)(unsafe.Pointer(&(*TSorterRecord)(unsafe.Pointer(pNew)).Fu)) = int32(int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList) - int64((*TVdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) } } else { - pNew = _sqlite3Malloc(tls, uint64(nReq)) + pNew = _sqlite3Malloc(tls, uint64(uint64(nReq))) if pNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -77303,11 +77379,11 @@ func _vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) (r int32) { if (*TPmaReader)(unsafe.Pointer(pReader)).FpFd == uintptr(0) { break } - if iEof+int64(nKey)+int64(_sqlite3VarintLen(tls, uint64(nKey))) > iStart+int64((*TIncrMerger)(unsafe.Pointer(pIncr)).FmxSz) { + if iEof+int64(int64(nKey))+int64(_sqlite3VarintLen(tls, uint64(uint64(nKey)))) > iStart+int64((*TIncrMerger)(unsafe.Pointer(pIncr)).FmxSz) { break } /* Write the next key to the output. */ - _vdbePmaWriteVarint(tls, bp, uint64(nKey)) + _vdbePmaWriteVarint(tls, bp, uint64(uint64(nKey))) _vdbePmaWriteBlob(tls, bp, (*TPmaReader)(unsafe.Pointer(pReader)).FaKey, nKey) rc = _vdbeMergeEngineStep(tls, (*TIncrMerger)(unsafe.Pointer(pIncr)).FpMerger, bp+48) } @@ -77604,9 +77680,9 @@ func _vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r if rc == SQLITE_OK { mxSz = (*TIncrMerger)(unsafe.Pointer(pIncr)).FmxSz if (*TIncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { - rc = _vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+40) + rc = _vdbeSorterOpenTempFile(tls, db, int64(int64(mxSz)), pIncr+40) if rc == SQLITE_OK { - rc = _vdbeSorterOpenTempFile(tls, db, int64(mxSz), pIncr+40+1*16) + rc = _vdbeSorterOpenTempFile(tls, db, int64(int64(mxSz)), pIncr+40+1*16) } } else { /*if( !pIncr->bUseThread )*/ @@ -77617,7 +77693,7 @@ func _vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) (r if rc == SQLITE_OK { (*(*TSorterFile)(unsafe.Pointer(pIncr + 40 + 1*16))).FpFd = (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd (*TIncrMerger)(unsafe.Pointer(pIncr)).FiStartOff = (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof - (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof += int64(mxSz) + (*TSortSubtask)(unsafe.Pointer(pTask)).Ffile2.FiEof += int64(int64(mxSz)) } } } @@ -77755,7 +77831,7 @@ func _vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) (r int32) { _, _ = nDepth, nDiv nDepth = 0 nDiv = int64(SORTER_MAX_MERGE_COUNT) - for nDiv < int64(nPMA) { + for nDiv < int64(int64(nPMA)) { nDiv = nDiv * int64(SORTER_MAX_MERGE_COUNT) nDepth++ } @@ -78200,7 +78276,7 @@ func _sqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCo if r2 == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TUnpackedRecord)(unsafe.Pointer(r2)).FnField = uint16(nKeyCol) + (*TUnpackedRecord)(unsafe.Pointer(r2)).FnField = uint16(uint16(nKeyCol)) } pKey = _vdbeSorterRowkey(tls, pSorter, bp) _sqlite3VdbeRecordUnpack(tls, pKeyInfo, *(*int32)(unsafe.Pointer(bp)), pKey, r2) @@ -78368,7 +78444,7 @@ func _memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst T p = pJfd zOut = zBuf nRead = iAmt - if int64(iAmt)+iOfst > (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset { + if int64(int64(iAmt))+iOfst > (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(2)< copy1.Fendpoint.FiOffset { + if iOff+int64(int64(nChunk)) > copy1.Fendpoint.FiOffset { nChunk = int32(copy1.Fendpoint.FiOffset - iOff) } rc = _sqlite3OsWrite(tls, pReal, pIter+8, nChunk, iOff) if rc != 0 { break } - iOff += int64(nChunk) + iOff += int64(int64(nChunk)) goto _1 _1: ; @@ -78509,7 +78585,7 @@ func _memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst zWrite = zBuf /* If the file should be created now, create it and write the new data ** into the file on disk. */ - if (*TMemJournal)(unsafe.Pointer(p)).FnSpill > 0 && int64(iAmt)+iOfst > int64((*TMemJournal)(unsafe.Pointer(p)).FnSpill) { + if (*TMemJournal)(unsafe.Pointer(p)).FnSpill > 0 && int64(int64(iAmt))+iOfst > int64((*TMemJournal)(unsafe.Pointer(p)).FnSpill) { rc = _memjrnlCreateFile(tls, p) if rc == SQLITE_OK { rc = _sqlite3OsWrite(tls, pJfd, zBuf, iAmt, iOfst) @@ -78525,7 +78601,7 @@ func _memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst _memjrnlTruncate(tls, pJfd, iOfst) } if iOfst == 0 && (*TMemJournal)(unsafe.Pointer(p)).FpFirst != 0 { - libc.Xmemcpy(tls, (*TMemJournal)(unsafe.Pointer(p)).FpFirst+8, zBuf, uint64(iAmt)) + libc.Xmemcpy(tls, (*TMemJournal)(unsafe.Pointer(p)).FpFirst+8, zBuf, uint64(uint64(iAmt))) } else { for nWrite > 0 { pChunk = (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk @@ -78552,10 +78628,10 @@ func _memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = v2 pChunk = v2 } - libc.Xmemcpy(tls, pChunk+8+uintptr(iChunkOffset), zWrite, uint64(iSpace)) + libc.Xmemcpy(tls, pChunk+8+uintptr(iChunkOffset), zWrite, uint64(uint64(iSpace))) zWrite += uintptr(iSpace) nWrite -= iSpace - (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset += int64(iSpace) + (*TMemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset += int64(int64(iSpace)) } } } @@ -79528,7 +79604,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol } cntTab++ pMatch = pItem - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(j) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(int16(j)) libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(j)*32+16+4, libc.Uint32FromInt32(1), 6, 0x40) /* rowid cannot be part of a USING clause - assert() this. */ if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x80>>7)) != 0 { @@ -79577,7 +79653,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(int32(hCol)) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { if cnt > 0 { if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 72)), zCol) < 0 { /* Two or more tables have the same column name which is @@ -79608,7 +79684,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { v5 = -int32(1) } else { - v5 = int32(int16(j)) + v5 = int32(int16(int16(j))) } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0 { @@ -79693,7 +79769,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(int32(hCol1)) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { iCol = -int32(1) } @@ -79714,11 +79790,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol pMatch = uintptr(0) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == int32(EXCLUDED_TABLE_NUMBER) { if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(iCol) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(int16(iCol)) *(*uintptr)(unsafe.Pointer(pExpr + 64)) = pTab eNewExprOp = int32(TK_COLUMN) } else { - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TUpsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16)))).FregData + int32(_sqlite3TableColumnToStorage(tls, pTab, int16(iCol))) + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TUpsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16)))).FregData + int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(iCol)))) eNewExprOp = int32(TK_REGISTER) } } else { @@ -79726,10 +79802,10 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { eNewExprOp = int32(TK_REGISTER) (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = uint8(TK_COLUMN) - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(iCol) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(&(*TNameContext)(unsafe.Pointer(pNC)).FuNC)) + (int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(1))*(*TExpr)(unsafe.Pointer(pExpr)).FiTable + int32(_sqlite3TableColumnToStorage(tls, pTab, int16(iCol))) + int32(1) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(int16(iCol)) + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(&(*TNameContext)(unsafe.Pointer(pNC)).FuNC)) + (int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(1))*(*TExpr)(unsafe.Pointer(pExpr)).FiTable + int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(iCol)))) + int32(1) } else { - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(iCol) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(int16(iCol)) eNewExprOp = int32(TK_TRIGGER) if iCol < 0 { (*TExpr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) @@ -79937,7 +80013,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 && cnt == int32(1) && pMatch != uintptr(0) { *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } - (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(uint8(eNewExprOp)) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -79983,7 +80060,7 @@ func _sqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 if int32((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64)))).FiPKey) == iCol { (*TExpr)(unsafe.Pointer(p)).FiColumn = int16(-int32(1)) } else { - (*TExpr)(unsafe.Pointer(p)).FiColumn = int16(iCol) + (*TExpr)(unsafe.Pointer(p)).FiColumn = int16(int16(iCol)) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) >= int32(64) { v2 = uint64(-libc.Int32FromInt32(1)) @@ -81797,7 +81874,7 @@ func _sqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) (r int8) { var v1 int32 _, _ = aff1, v1 aff1 = _sqlite3ExprAffinity(tls, pExpr) - if int32(aff1) > int32(SQLITE_AFF_NONE) && int32(aff2) > int32(SQLITE_AFF_NONE) { + if int32(int32(aff1)) > int32(SQLITE_AFF_NONE) && int32(int32(aff2)) > int32(SQLITE_AFF_NONE) { /* Both sides of the comparison are columns. If one has numeric ** affinity, use that. Otherwise use no affinity. */ @@ -81808,10 +81885,10 @@ func _sqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) (r int8) { } } else { /* One side is a column, the other is not. Use the columns affinity. */ - if int32(aff1) <= int32(SQLITE_AFF_NONE) { - v1 = int32(aff2) + if int32(int32(aff1)) <= int32(SQLITE_AFF_NONE) { + v1 = int32(int32(aff2)) } else { - v1 = int32(aff1) + v1 = int32(int32(aff1)) } return int8(v1 | int32(SQLITE_AFF_NONE)) } @@ -81834,7 +81911,7 @@ func _comparisonAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { aff = _sqlite3CompareAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList + 8))).FpExpr, aff) } else { - if int32(aff) == 0 { + if int32(int32(aff)) == 0 { aff = int8(SQLITE_AFF_BLOB) } } @@ -81854,11 +81931,11 @@ func _sqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) (r var aff int8 _ = aff aff = _comparisonAffinity(tls, pExpr) - if int32(aff) < int32(SQLITE_AFF_TEXT) { + if int32(int32(aff)) < int32(SQLITE_AFF_TEXT) { return int32(1) } - if int32(aff) == int32(SQLITE_AFF_TEXT) { - return libc.BoolInt32(int32(idx_affinity) == int32(SQLITE_AFF_TEXT)) + if int32(int32(aff)) == int32(SQLITE_AFF_TEXT) { + return libc.BoolInt32(int32(int32(idx_affinity)) == int32(SQLITE_AFF_TEXT)) } return libc.BoolInt32(int32(idx_affinity) >= int32(SQLITE_AFF_NUMERIC)) } @@ -81873,7 +81950,7 @@ func _binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull var aff Tu8 _ = aff aff = uint8(_sqlite3ExprAffinity(tls, pExpr2)) - aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(uint8(jumpIfNull))) + aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, pExpr1, int8(int8(aff))))) | int32(uint8(uint8(jumpIfNull)))) return aff } @@ -81947,7 +82024,7 @@ func _codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, } p5 = int32(_binaryCompareP5(tls, pLeft, pRight, jumpIfNull)) addr = _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, opcode, in2, dest, in1, p4, -int32(2)) - _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, uint16(uint8(p5))) + _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, uint16(uint8(uint8(p5)))) return addr } @@ -81978,13 +82055,13 @@ func _sqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) (r int32) { var op Tu8 _ = op op = (*TExpr)(unsafe.Pointer(pExpr)).Fop - if int32(op) == int32(TK_REGISTER) { + if int32(int32(op)) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(pExpr)).Fop2 } - if int32(op) == int32(TK_VECTOR) { + if int32(int32(op)) == int32(TK_VECTOR) { return (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - if int32(op) == int32(TK_SELECT) { + if int32(int32(op)) == int32(TK_SELECT) { return (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList)).FnExpr } else { return int32(1) @@ -82068,7 +82145,7 @@ func _sqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, if pRet != 0 { *(*Tu32)(unsafe.Pointer(pRet + 4)) |= uint32(libc.Int32FromInt32(EP_FullSize)) (*TExpr)(unsafe.Pointer(pRet)).FiTable = nField - (*TExpr)(unsafe.Pointer(pRet)).FiColumn = int16(iField) + (*TExpr)(unsafe.Pointer(pRet)).FiColumn = int16(int16(iField)) (*TExpr)(unsafe.Pointer(pRet)).FpLeft = pVector } } else { @@ -82130,15 +82207,15 @@ func _exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField var op Tu8 _ = op op = (*TExpr)(unsafe.Pointer(pVector)).Fop - if int32(op) == int32(TK_REGISTER) { + if int32(int32(op)) == int32(TK_REGISTER) { *(*uintptr)(unsafe.Pointer(ppExpr)) = _sqlite3VectorFieldSubexpr(tls, pVector, iField) return (*TExpr)(unsafe.Pointer(pVector)).FiTable + iField } - if int32(op) == int32(TK_SELECT) { + if int32(int32(op)) == int32(TK_SELECT) { *(*uintptr)(unsafe.Pointer(ppExpr)) = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)))).FpEList + 8 + uintptr(iField)*32))).FpExpr return regSelect + iField } - if int32(op) == int32(TK_VECTOR) { + if int32(int32(op)) == int32(TK_VECTOR) { *(*uintptr)(unsafe.Pointer(ppExpr)) = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pVector + 32)) + 8 + uintptr(iField)*32))).FpExpr return _sqlite3ExprCodeTemp(tls, pParse, *(*uintptr)(unsafe.Pointer(ppExpr)), pRegFree) } @@ -82186,13 +82263,13 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6681, 0) return } - if int32(op) == int32(TK_LE) { + if int32(int32(op)) == int32(TK_LE) { opx = uint8(TK_LT) } - if int32(op) == int32(TK_GE) { + if int32(int32(op)) == int32(TK_GE) { opx = uint8(TK_GT) } - if int32(op) == int32(TK_NE) { + if int32(int32(op)) == int32(TK_NE) { opx = uint8(TK_EQ) } regLeft = _exprCodeSubselect(tls, pParse, pLeft) @@ -82213,13 +82290,13 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 r1 = _exprVectorRegister(tls, pParse, pLeft, i, regLeft, bp+8, bp) r2 = _exprVectorRegister(tls, pParse, pRight, i, regRight, bp+16, bp+4) addrCmp = _sqlite3VdbeCurrentAddr(tls, v) - _codeCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(opx), r1, r2, addrDone, int32(p5), isCommuted) + _codeCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(int32(opx)), r1, r2, addrDone, int32(int32(p5)), isCommuted) _sqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp))) _sqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 4))) - if (int32(opx) == int32(TK_LT) || int32(opx) == int32(TK_GT)) && i < nLeft-int32(1) { + if (int32(int32(opx)) == int32(TK_LT) || int32(int32(opx)) == int32(TK_GT)) && i < nLeft-int32(1) { addrCmp = _sqlite3VdbeAddOp0(tls, v, int32(OP_ElseEq)) } - if int32(p5) == int32(SQLITE_NULLEQ) { + if int32(int32(p5)) == int32(SQLITE_NULLEQ) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, dest) } else { _sqlite3VdbeAddOp3(tls, v, int32(OP_ZeroOrNull), r1, dest, r2) @@ -82227,7 +82304,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 if i == nLeft-int32(1) { break } - if int32(opx) == int32(TK_EQ) { + if int32(int32(opx)) == int32(TK_EQ) { _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), dest, addrDone) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, addrDone) @@ -82242,7 +82319,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 } _sqlite3VdbeJumpHere(tls, v, addrCmp) _sqlite3VdbeResolveLabel(tls, v, addrDone) - if int32(op) == int32(TK_NE) { + if int32(int32(op)) == int32(TK_NE) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Not), dest, dest) } } @@ -82448,10 +82525,10 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = int32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+uint64(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+uint64(uint64(nExtra)))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) - (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(uint8(op)) (*TExpr)(unsafe.Pointer(pNew)).FiAgg = int16(-int32(1)) if pToken != 0 { if nExtra == 0 { @@ -82835,11 +82912,11 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n return } x = int16(*(*Ti64)(unsafe.Pointer(bp))) - if int32(x) > int32((*TParse)(unsafe.Pointer(pParse)).FnVar) { - (*TParse)(unsafe.Pointer(pParse)).FnVar = int16(int32(x)) + if int32(int32(x)) > int32((*TParse)(unsafe.Pointer(pParse)).FnVar) { + (*TParse)(unsafe.Pointer(pParse)).FnVar = int16(int32(int32(x))) doAdd = int32(1) } else { - if _sqlite3VListNumToName(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, int32(x)) == uintptr(0) { + if _sqlite3VListNumToName(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, int32(int32(x))) == uintptr(0) { doAdd = int32(1) } } @@ -82848,8 +82925,8 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n ** number as the prior appearance of the same name, or if the name ** has never appeared before, reuse the same variable number */ - x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(n))) - if int32(x) == 0 { + x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(int32(n)))) + if int32(int32(x)) == 0 { v4 = pParse + 304 *(*TynVar)(unsafe.Pointer(v4))++ v3 = *(*TynVar)(unsafe.Pointer(v4)) @@ -82858,11 +82935,11 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } } if doAdd != 0 { - (*TParse)(unsafe.Pointer(pParse)).FpVList = _sqlite3VListAdd(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(n), int32(x)) + (*TParse)(unsafe.Pointer(pParse)).FpVList = _sqlite3VListAdd(tls, db, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(int32(n)), int32(int32(x))) } } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x - if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { + if int32(int32(x)) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7814, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } @@ -83120,13 +83197,13 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin } else { if !((*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_IntValue)) != libc.Uint32FromInt32(0)) && *(*uintptr)(unsafe.Pointer(p + 8)) != 0 { nToken = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8)))&uint64(0x3fffffff) + uint64(1)) - nAlloc = int32((libc.Uint64FromInt64(72) + uint64(nToken) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) + nAlloc = int32((libc.Uint64FromInt64(72) + uint64(uint64(nToken)) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) } else { nToken = 0 nAlloc = int32((libc.Uint64FromInt64(72) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) } } - (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc = _sqlite3DbMallocRawNN(tls, db, uint64(nAlloc)) + (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(nAlloc))) staticFlag = uint32(0) } pNew = (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc @@ -83146,12 +83223,12 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin } } if dupFlags != 0 { - libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, uint64(nNewSize)) + libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, uint64(uint64(nNewSize))) } else { nSize = uint32(_exprStructSize(tls, p)) - libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, uint64(nSize)) - if uint64(nSize) < uint64(72) { - libc.Xmemset(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc+uintptr(nSize), 0, uint64(72)-uint64(nSize)) + libc.Xmemcpy(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc, p, uint64(uint64(nSize))) + if uint64(uint64(nSize)) < uint64(72) { + libc.Xmemset(tls, (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc+uintptr(nSize), 0, uint64(72)-uint64(uint64(nSize))) } nNewSize = int32(72) } @@ -83166,7 +83243,7 @@ func _exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pEdupBuf uin v1 = (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc + uintptr(nNewSize) *(*uintptr)(unsafe.Pointer(pNew + 8)) = v1 zToken = v1 - libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), uint64(nToken)) + libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8)), uint64(uint64(nToken))) nNewSize += nToken } (*(*TEdupBuf)(unsafe.Pointer(bp))).FzAlloc += uintptr((nNewSize + libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)) @@ -83234,7 +83311,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { pRet = uintptr(0) if p != 0 { nByte = int64(uint64(64) + uint64(48)*uint64((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) - pRet = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + pRet = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte))) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte i = 0 @@ -83408,7 +83485,7 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui v1 = uint64(0) } nByte = int32(uint64(112) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(nByte))) if pNew == uintptr(0) { return uintptr(0) } @@ -83468,7 +83545,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(24)+uint64((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(16)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(24)+uint64((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(16))) if pNew == uintptr(0) { return uintptr(0) } @@ -83602,7 +83679,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83620,7 +83697,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+uint64((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(40)+uint64((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83733,6 +83810,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -83755,7 +83833,7 @@ func _sqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN if iSortOrder == -int32(1) { iSortOrder = SQLITE_SO_ASC } - (*TExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags = uint8(iSortOrder) + (*TExprList_item)(unsafe.Pointer(pItem)).Ffg.FsortFlags = uint8(uint8(iSortOrder)) if eNulls != -int32(1) { libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(1), 5, 0x20) if iSortOrder != eNulls { @@ -84116,7 +84194,7 @@ func _exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) (r int32 bp := tls.Alloc(48) defer tls.Free(48) var _ /* w at bp+0 */ TWalker - (*(*TWalker)(unsafe.Pointer(bp))).FeCode = uint16(initFlag) + (*(*TWalker)(unsafe.Pointer(bp))).FeCode = uint16(uint16(initFlag)) (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeIsConstant) (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkFail) *(*int32)(unsafe.Pointer(bp + 40)) = iCur @@ -84348,7 +84426,7 @@ func _sqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p // ** a constant. // */ func _sqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit Tu8) (r int32) { - return _exprIsConst(tls, p, int32(4)+int32(isInit), 0) + return _exprIsConst(tls, p, int32(4)+int32(int32(isInit)), 0) } // C documentation @@ -84413,10 +84491,10 @@ func _sqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) (r int32) { p = (*TExpr)(unsafe.Pointer(p)).FpLeft } op = (*TExpr)(unsafe.Pointer(p)).Fop - if int32(op) == int32(TK_REGISTER) { + if int32(int32(op)) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(p)).Fop2 } - switch int32(op) { + switch int32(int32(op)) { case int32(TK_INTEGER): fallthrough case int32(TK_STRING): @@ -84450,7 +84528,7 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in var unaryMinus int32 _, _ = op, unaryMinus unaryMinus = 0 - if int32(aff) == int32(SQLITE_AFF_BLOB) { + if int32(int32(aff)) == int32(SQLITE_AFF_BLOB) { return int32(1) } for int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UPLUS) || int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_UMINUS) { @@ -84460,21 +84538,21 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in p = (*TExpr)(unsafe.Pointer(p)).FpLeft } op = (*TExpr)(unsafe.Pointer(p)).Fop - if int32(op) == int32(TK_REGISTER) { + if int32(int32(op)) == int32(TK_REGISTER) { op = (*TExpr)(unsafe.Pointer(p)).Fop2 } - switch int32(op) { + switch int32(int32(op)) { case int32(TK_INTEGER): - return libc.BoolInt32(int32(aff) >= int32(SQLITE_AFF_NUMERIC)) + return libc.BoolInt32(int32(int32(aff)) >= int32(SQLITE_AFF_NUMERIC)) case int32(TK_FLOAT): - return libc.BoolInt32(int32(aff) >= int32(SQLITE_AFF_NUMERIC)) + return libc.BoolInt32(int32(int32(aff)) >= int32(SQLITE_AFF_NUMERIC)) case int32(TK_STRING): - return libc.BoolInt32(!(unaryMinus != 0) && int32(aff) == int32(SQLITE_AFF_TEXT)) + return libc.BoolInt32(!(unaryMinus != 0) && int32(int32(aff)) == int32(SQLITE_AFF_TEXT)) case int32(TK_BLOB): return libc.BoolInt32(!(unaryMinus != 0)) case int32(TK_COLUMN): /* p cannot be part of a CHECK constraint */ - return libc.BoolInt32(int32(aff) >= int32(SQLITE_AFF_NUMERIC) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < 0) + return libc.BoolInt32(int32(int32(aff)) >= int32(SQLITE_AFF_NUMERIC) && int32((*TExpr)(unsafe.Pointer(p)).FiColumn) < 0) default: return 0 } @@ -84812,7 +84890,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iCol = int32((*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pEList1 + 8 + uintptr(i1)*32))).FpExpr)).FiColumn) idxaff = _sqlite3TableColumnAffinity(tls, pTab, iCol) /* RHS table */ cmpaff = _sqlite3CompareAffinity(tls, pLhs, idxaff) - switch int32(cmpaff) { + switch int32(int32(cmpaff)) { case int32(SQLITE_AFF_BLOB): case int32(SQLITE_AFF_TEXT): /* sqlite3CompareAffinity() only returns TEXT if one side or the @@ -84953,7 +85031,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if rMayHaveNull != 0 { _sqlite3SetHasNullFlag(tls, v, iTab, rMayHaveNull) } - (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16(savedNQueryLoop) + (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16(int16(savedNQueryLoop)) } if aiMap != 0 && eType != int32(IN_INDEX_INDEX_ASC) && eType != int32(IN_INDEX_INDEX_DESC) { n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) @@ -85489,7 +85567,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nVector)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1))+uint64(1)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(uint64(nVector))*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1))+uint64(1))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85709,11 +85787,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -85804,12 +85884,12 @@ func _sqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr var iTabCol Ti16 _ = iTabCol iTabCol = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2)) - if int32(iTabCol) == -int32(2) { + if int32(int32(iTabCol)) == -int32(2) { (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = iTabCur + int32(1) _sqlite3ExprCodeCopy(tls, pParse, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(iIdxCol)*32))).FpExpr, regOut) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } else { - _sqlite3ExprCodeGetColumnOfTable(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TIndex)(unsafe.Pointer(pIdx)).FpTable, iTabCur, int32(iTabCol), regOut) + _sqlite3ExprCodeGetColumnOfTable(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TIndex)(unsafe.Pointer(pIdx)).FpTable, iTabCur, int32(int32(iTabCol)), regOut) } } @@ -85879,10 +85959,10 @@ func _sqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT return } else { if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - x = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab), int16(iCol))) + x = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab), int16(int16(iCol)))) op = int32(OP_Column) } else { - x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(iCol))) + x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(iCol)))) op = int32(OP_Column) } } @@ -85908,10 +85988,10 @@ func _sqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iCol if p5 != 0 { pOp = _sqlite3VdbeGetLastOp(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe) if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Column) { - (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(p5) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(uint16(p5)) } if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_VColumn) { - (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(int32(p5) & libc.Int32FromInt32(OPFLAG_NOCHNG)) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fp5 = uint16(int32(int32(p5)) & libc.Int32FromInt32(OPFLAG_NOCHNG)) } } return iReg @@ -86090,10 +86170,10 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc 5: __ccgo_ts + 8214, } aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr) - if int32(aff) <= int32(SQLITE_AFF_NONE) { + if int32(int32(aff)) <= int32(SQLITE_AFF_NONE) { v2 = __ccgo_ts + 8222 } else { - v2 = azAff[int32(aff)-int32(SQLITE_AFF_BLOB)] + v2 = azAff[int32(int32(aff))-int32(SQLITE_AFF_BLOB)] } _sqlite3VdbeLoadString(tls, v, target, v2) break @@ -86133,7 +86213,7 @@ func _sqlite3IndexedExprLookup(tls *libc.TLS, pParse uintptr, pExpr uintptr, tar goto _1 } exprAff = uint8(_sqlite3ExprAffinity(tls, pExpr)) - if int32(exprAff) <= int32(SQLITE_AFF_BLOB) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_BLOB) || int32(exprAff) == int32(SQLITE_AFF_TEXT) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_TEXT) || int32(exprAff) >= int32(SQLITE_AFF_NUMERIC) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_NUMERIC) { + if int32(int32(exprAff)) <= int32(SQLITE_AFF_BLOB) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_BLOB) || int32(int32(exprAff)) == int32(SQLITE_AFF_TEXT) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_TEXT) || int32(int32(exprAff)) >= int32(SQLITE_AFF_NUMERIC) && int32((*TIndexedExpr)(unsafe.Pointer(p)).Faff) != int32(SQLITE_AFF_NUMERIC) { /* Affinity mismatch on a generated column */ goto _1 } @@ -86237,6 +86317,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -86307,7 +86388,7 @@ expr_code_doover: return -int32(1) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab } pCol1 = (*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*16 - iSrc = int32(_sqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab + iSrc = int32(_sqlite3TableColumnToStorage(tls, pTab1, int16(int16(iCol)))) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { if int32((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8166, libc.VaList(bp+160, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) @@ -86411,7 +86492,7 @@ expr_code_doover: case int32(TK_EQ): pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprIsVector(tls, pLeft) != 0 { - _codeVectorCompare(tls, pParse, pExpr, target, uint8(op), uint8(p5)) + _codeVectorCompare(tls, pParse, pExpr, target, uint8(uint8(op)), uint8(uint8(p5))) } else { r1 = _sqlite3ExprCodeTemp(tls, pParse, pLeft, bp) r2 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpRight, bp+4) @@ -86555,7 +86636,7 @@ expr_code_doover: */ if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_LENGTH)|libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)) != uint32(0) { exprOp = (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr)).Fop - if int32(exprOp) == int32(TK_COLUMN) || int32(exprOp) == int32(TK_AGG_COLUMN) { + if int32(int32(exprOp)) == int32(TK_COLUMN) || int32(int32(exprOp)) == int32(TK_AGG_COLUMN) { (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr)).Fop2 = uint8((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags & uint32(OPFLAG_BYTELENARG)) } } @@ -86588,7 +86669,7 @@ expr_code_doover: } _sqlite3VdbeAddOp4(tls, v, int32(OP_CollSeq), 0, 0, 0, pColl, -int32(2)) } - _sqlite3VdbeAddFunctionCall(tls, pParse, int32(constMask), r1, target, nFarg, pDef, int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2)) + _sqlite3VdbeAddFunctionCall(tls, pParse, int32(int32(constMask)), r1, target, nFarg, pDef, int32((*TExpr)(unsafe.Pointer(pExpr)).Fop2)) if nFarg != 0 { if constMask == uint32(0) { _sqlite3ReleaseTempRange(tls, pParse, r1, nFarg) @@ -86671,7 +86752,7 @@ expr_code_doover: case int32(TK_TRIGGER): pTab2 = *(*uintptr)(unsafe.Pointer(pExpr + 64)) iCol1 = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - p1 = (*TExpr)(unsafe.Pointer(pExpr)).FiTable*(int32((*TTable)(unsafe.Pointer(pTab2)).FnCol)+int32(1)) + int32(1) + int32(_sqlite3TableColumnToStorage(tls, pTab2, int16(iCol1))) + p1 = (*TExpr)(unsafe.Pointer(pExpr)).FiTable*(int32((*TTable)(unsafe.Pointer(pTab2)).FnCol)+int32(1)) + int32(1) + int32(_sqlite3TableColumnToStorage(tls, pTab2, int16(int16(iCol1)))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Param), p1, target) /* If the column has REAL affinity, it may currently be stored as an ** integer. Use OP_RealAffinity to make sure it is really real. @@ -86956,7 +87037,7 @@ func _sqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 } else { op = uint8(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) + _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(int32(op)), inReg, target) } } @@ -87022,7 +87103,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ var pExpr, pItem, pOp, v, v5 uintptr var v4, v6 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _ = copyOp, i, inReg, j, n, pExpr, pItem, pOp, v, v1, v3, v4, v5, v6 - if int32(flags)&int32(SQLITE_ECEL_DUP) != 0 { + if int32(int32(flags))&int32(SQLITE_ECEL_DUP) != 0 { v1 = int32(OP_Copy) } else { v1 = int32(OP_SCopy) @@ -87041,7 +87122,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ break } pExpr = (*TExprList_item)(unsafe.Pointer(pItem)).FpExpr - if v4 = int32(flags)&int32(SQLITE_ECEL_REF) != 0; v4 { + if v4 = int32(int32(flags))&int32(SQLITE_ECEL_REF) != 0; v4 { v3 = int32((*(*struct { FiOrderByCol Tu16 FiAlias Tu16 @@ -87049,26 +87130,26 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ j = v3 } if v4 && v3 > 0 { - if int32(flags)&int32(SQLITE_ECEL_OMITREF) != 0 { + if int32(int32(flags))&int32(SQLITE_ECEL_OMITREF) != 0 { i-- n-- } else { - _sqlite3VdbeAddOp2(tls, v, int32(copyOp), j+srcReg-int32(1), target+i) + _sqlite3VdbeAddOp2(tls, v, int32(int32(copyOp)), j+srcReg-int32(1), target+i) } } else { - if int32(flags)&int32(SQLITE_ECEL_FACTOR) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 { + if int32(int32(flags))&int32(SQLITE_ECEL_FACTOR) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target+i) } else { inReg = _sqlite3ExprCodeTarget(tls, pParse, pExpr, target+i) if inReg != target+i { - if v6 = int32(copyOp) == int32(OP_Copy); v6 { + if v6 = int32(int32(copyOp)) == int32(OP_Copy); v6 { v5 = _sqlite3VdbeGetLastOp(tls, v) pOp = v5 } if v6 && int32((*TVdbeOp)(unsafe.Pointer(v5)).Fopcode) == int32(OP_Copy) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == inReg && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2+(*TVdbeOp)(unsafe.Pointer(pOp)).Fp3+int32(1) == target+i && int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3++ } else { - _sqlite3VdbeAddOp2(tls, v, int32(copyOp), inReg, target+i) + _sqlite3VdbeAddOp2(tls, v, int32(int32(copyOp)), inReg, target+i) } } } @@ -87320,6 +87401,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -87525,6 +87607,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -88258,7 +88341,7 @@ func _exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } i = 0 for { - if !(int64(i) < (*TRefSrcList)(unsafe.Pointer(p)).FnExclude && *(*int32)(unsafe.Pointer((*TRefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(i)*4)) != (*TExpr)(unsafe.Pointer(pExpr)).FiTable) { + if !(int64(int64(i)) < (*TRefSrcList)(unsafe.Pointer(p)).FnExclude && *(*int32)(unsafe.Pointer((*TRefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(i)*4)) != (*TExpr)(unsafe.Pointer(pExpr)).FiTable) { break } goto _4 @@ -88266,7 +88349,7 @@ func _exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ; i++ } - if int64(i) >= (*TRefSrcList)(unsafe.Pointer(p)).FnExclude { + if int64(int64(i)) >= (*TRefSrcList)(unsafe.Pointer(p)).FnExclude { p5 = pWalker + 36 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(2)) } @@ -88464,7 +88547,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(int16(j)) break } goto _2 @@ -88480,13 +88563,14 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) } - (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(k) + (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(int16(k)) } // C documentation @@ -88669,7 +88753,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) } /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry */ - (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(i) + (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = int16(int16(i)) (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo return int32(WRC_Prune) } else { @@ -89080,6 +89164,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9923, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89284,7 +89369,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(nAlloc)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*uint64(uint64(nAlloc)))) (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10781, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column @@ -89322,6 +89407,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89438,6 +89524,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9923, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -90068,16 +90155,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) - libc.Xmemcpy(tls, zOut, zSql, uint64(nSql)) + nOut = int32(int32(nSql)) + libc.Xmemcpy(tls, zOut, zSql, uint64(uint64(nSql))) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { if bQuote == 0 && _sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = uint32(nNew) + nReplace = uint32(uint32(nNew)) zReplace = zNew } else { - nReplace = uint32(nQuot) + nReplace = uint32(uint32(nQuot)) zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90102,13 +90189,13 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zReplace = zBuf2 nReplace = uint32(_sqlite3Strlen30(tls, zReplace)) } - iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) + iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(int64(zSql))) if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(uint32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(uint32(nOut)-(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + libc.Xmemmove(tls, zOut+uintptr(uint32(uint32(iOff))+nReplace), zOut+uintptr(uint32(uint32(iOff))+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(uint32(uint32(nOut))-(uint32(uint32(iOff))+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(uint64(nReplace))) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90134,7 +90221,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, uint32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, uint32(uint32(val)), 0, 0x3) goto _1 _1: ; @@ -90575,6 +90662,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -91087,9 +91175,10 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11250, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11250, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(int64(zSql)), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -91217,8 +91306,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(int16(i)))) + iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(int16(iCol)))) if iPos < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91254,6 +91343,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -91668,10 +91758,10 @@ func _sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintpt if (*TStatSample)(unsafe.Pointer(p)).FnRowid != 0 { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24))) } - *(*uintptr)(unsafe.Pointer(p + 24)) = _sqlite3DbMallocRawNN(tls, db, uint64(n)) + *(*uintptr)(unsafe.Pointer(p + 24)) = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(n))) if *(*uintptr)(unsafe.Pointer(p + 24)) != 0 { - (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(n) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 24)), pData, uint64(n)) + (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(uint32(n)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 24)), pData, uint64(uint64(n))) } else { (*TStatSample)(unsafe.Pointer(p)).FnRowid = uint32(0) } @@ -91788,12 +91878,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = int32(uint64(136) + uint64(8)*uint64(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*uint64(nColUp)) /* StatAccum.anEq */ + n = int32(uint64(136) + uint64(8)*uint64(uint64(nColUp))) /* StatAccum.anDLt */ + n = int32(uint64(n) + libc.Uint64FromInt64(8)*uint64(uint64(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*uint64(nColUp) + libc.Uint64FromInt64(48)*uint64(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*uint64(nColUp)*uint64(nCol+mxSample))) + n = int32(uint64(n) + (libc.Uint64FromInt64(8)*uint64(uint64(nColUp)) + libc.Uint64FromInt64(48)*uint64(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*uint64(uint64(nColUp))*uint64(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, uint64(n)) + p = _sqlite3DbMallocZero(tls, db, uint64(uint64(n))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -91817,7 +91907,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).FiGet = -int32(1) (*TStatAccum)(unsafe.Pointer(p)).FnPSample = (*TStatAccum)(unsafe.Pointer(p)).FnEst/uint64(mxSample/libc.Int32FromInt32(3)+libc.Int32FromInt32(1)) + libc.Uint64FromInt32(1) (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*8 - (*TStatAccum)(unsafe.Pointer(p)).FiPrn = uint32(0x689e962d)*uint32(nCol) ^ uint32(0xd0944565)*uint32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FiPrn = uint32(0x689e962d)*uint32(uint32(nCol)) ^ uint32(0xd0944565)*uint32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) /* Set up the StatAccum.a[] and aBest[] arrays */ (*TStatAccum)(unsafe.Pointer(p)).Fa = (*TStatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*8 (*TStatAccum)(unsafe.Pointer(p)).FaBest = (*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*48 @@ -91828,11 +91918,11 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { break } (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48))).FanEq = pSpace - pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(nColUp)) + pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(uint64(nColUp))) (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48))).FanLt = pSpace - pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(nColUp)) + pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(uint64(nColUp))) (*(*TStatSample)(unsafe.Pointer((*TStatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48))).FanDLt = pSpace - pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(nColUp)) + pSpace += uintptr(libc.Uint64FromInt64(8) * uint64(uint64(nColUp))) goto _3 _3: ; @@ -92005,7 +92095,8 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { _sampleCopy(tls, p, pSample, pNew) (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ - libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(uint64(nEqZero))) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -92426,7 +92517,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } @@ -92551,7 +92642,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*uint64(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*uint64(uint64(nColTest)))) if aGotoChng == uintptr(0) { goto _13 } @@ -92707,7 +92798,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _callStatGet(tls, pParse, regStat, int32(STAT_GET_NEQ), regEq) _callStatGet(tls, pParse, regStat, int32(STAT_GET_NLT), regLt) _callStatGet(tls, pParse, regStat, int32(STAT_GET_NDLT), regDLt) - _sqlite3VdbeAddOp4Int(tls, v, int32(seekOp), iTabCur, addrNext, regSampleRowid, 0) + _sqlite3VdbeAddOp4Int(tls, v, int32(int32(seekOp)), iTabCur, addrNext, regSampleRowid, 0) i = 0 for { if !(i < nCol) { @@ -92957,7 +93048,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, if !(v2 >= int32('0') && c <= int32('9')) { break } - v = v*uint64(10) + uint64(c) - uint64('0') + v = v*uint64(10) + uint64(uint64(c)) - uint64('0') z++ } if aOut != 0 { @@ -92986,7 +93077,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, if sz < int32(2) { sz = int32(2) } - (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, uint64(sz)) + (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, uint64(uint64(sz))) } else { if Xsqlite3_strglob(tls, __ccgo_ts+11826, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) @@ -93057,7 +93148,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*uint64(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*uint64(uint64(nCol)))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -93258,10 +93349,10 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u } (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample - nByte = int32(uint64(40) * uint64(nSample)) - nByte = int32(uint64(nByte) + libc.Uint64FromInt64(8)*uint64(nIdxCol)*libc.Uint64FromInt32(3)*uint64(nSample)) - nByte = int32(uint64(nByte) + uint64(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ - (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = int32(uint64(40) * uint64(uint64(nSample))) + nByte = int32(uint64(nByte) + libc.Uint64FromInt64(8)*uint64(uint64(nIdxCol))*libc.Uint64FromInt32(3)*uint64(uint64(nSample))) + nByte = int32(uint64(nByte) + uint64(uint64(nIdxCol))*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte))) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) return int32(SQLITE_NOMEM) @@ -93658,13 +93749,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*uint64((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint64(32)*uint64((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) if aNew == uintptr(0) { return } @@ -93756,6 +93847,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -93836,6 +93928,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -93890,6 +93983,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -94452,7 +94546,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc i++ } nBytes = int32(uint64(24) * uint64((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) - (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes)) + (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(uint64(nBytes))) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { v4 = pToplevel + 156 v3 = *(*int32)(unsafe.Pointer(v4)) @@ -95227,7 +95321,7 @@ func _sqlite3ColumnSetColl(tls *libc.TLS, db uintptr, pCol uintptr, zColl uintpt zNew = _sqlite3DbRealloc(tls, db, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, uint64(nColl+n)) if zNew != 0 { (*TColumn)(unsafe.Pointer(pCol)).FzCnName = zNew - libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, uint64(nColl)) + libc.Xmemcpy(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName+uintptr(n), zColl, uint64(uint64(nColl))) p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_HASCOLL)) } @@ -95627,8 +95721,8 @@ func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(int32(iCol)) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return int16(int16(i)) } goto _1 _1: @@ -95657,7 +95751,7 @@ func _sqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasVirtual) != 0 { i = 0 for { - if !(i <= int32(iCol)) { + if !(i <= int32(int32(iCol))) { break } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { @@ -95714,13 +95808,13 @@ func _sqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 var i int32 var n Ti16 _, _ = i, n - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasVirtual) == uint32(0) || int32(iCol) < 0 { + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasVirtual) == uint32(0) || int32(int32(iCol)) < 0 { return iCol } i = 0 n = libc.Int16FromInt32(0) for { - if !(i < int32(iCol)) { + if !(i < int32(int32(iCol))) { break } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { @@ -95733,7 +95827,7 @@ func _sqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol Ti16) (r Ti1 } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { /* iCol is a virtual column itself */ - return int16(int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol) + i - int32(n)) + return int16(int32((*TTable)(unsafe.Pointer(pTab)).FnNVCol) + i - int32(int32(n))) } else { /* iCol is a normal or stored column */ return n @@ -95967,6 +96061,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -96129,7 +96224,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok (*(*TToken)(unsafe.Pointer(bp + 16))).Fn = uint32(0) eType = uint8(i + int32(1)) affinity = _sqlite3StdTypeAffinity[i] - if int32(affinity) <= int32(SQLITE_AFF_TEXT) { + if int32(int32(affinity)) <= int32(SQLITE_AFF_TEXT) { szEst = uint8(5) } break @@ -96156,7 +96251,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == int32(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == int32(int32(hName)) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12744, libc.VaList(bp+40, z)) _sqlite3DbFree(tls, db, z) return @@ -96180,7 +96275,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ (*TColumn)(unsafe.Pointer(pCol)).Faffinity = affinity - libc.SetBitFieldPtr8Uint32(pCol+8, uint32(eType), 4, 0xf0) + libc.SetBitFieldPtr8Uint32(pCol+8, uint32(uint32(eType)), 4, 0xf0) (*TColumn)(unsafe.Pointer(pCol)).FszEst = szEst } else { zType = z + uintptr(_sqlite3Strlen30(tls, z)) + uintptr(1) @@ -96212,7 +96307,7 @@ func _sqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { return } pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 - libc.SetBitFieldPtr8Uint32(pCol+8, uint32(uint8(onError)), 0, 0xf) + libc.SetBitFieldPtr8Uint32(pCol+8, uint32(uint8(uint8(onError))), 0, 0xf) *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_HasNotNull) /* Set the uniqNotNull flag on any UNIQUE or PK indexes already created ** on this column. */ @@ -96286,19 +96381,19 @@ func _sqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) (r int8) { if h == uint32(libc.Int32FromUint8('t')<= N { return SQLITE_OK } - nByte = int32((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * uint64(N)) - zExtra = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + nByte = int32((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * uint64(uint64(N))) + zExtra = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte))) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FazColl, uint64(8)*uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FazColl = zExtra - zExtra += uintptr(uint64(8) * uint64(N)) + zExtra += uintptr(uint64(8) * uint64(uint64(N))) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst, uint64(2)*uint64(int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra - zExtra += uintptr(uint64(2) * uint64(N)) + zExtra += uintptr(uint64(2) * uint64(uint64(N))) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn, uint64(2)*uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn = zExtra - zExtra += uintptr(uint64(2) * uint64(N)) + zExtra += uintptr(uint64(2) * uint64(uint64(N))) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(uint16(N)) libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -96973,7 +97071,7 @@ func _estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { break } x = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)) - if int32(x) < 0 { + if int32(int32(x)) < 0 { v2 = int32(1) } else { v2 = int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(x)*16))).FszEst) @@ -97204,7 +97302,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - (*TIndex)(unsafe.Pointer(pPk)).FnKeyCol = uint16(j) + (*TIndex)(unsafe.Pointer(pPk)).FnKeyCol = uint16(uint16(j)) } libc.SetBitFieldPtr16Uint32(pPk+100, libc.Uint32FromInt32(1), 5, 0x20) if !(int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x2>>1)) != 0) { @@ -97307,7 +97405,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { break } if !(_hasColumn(tls, (*TIndex)(unsafe.Pointer(pPk)).FaiColumn, j, i) != 0) && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { - *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)) = int16(i) + *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)) = int16(int16(i)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) j++ } @@ -97846,6 +97944,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -98154,7 +98253,7 @@ func _destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { return } else { iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _destroyRootPage(tls, pParse, int32(iLargest), iDb) + _destroyRootPage(tls, pParse, int32(int32(iLargest)), iDb) iDestroyed = iLargest } } @@ -98306,7 +98405,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if noErr != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FsuppressErr++ } - pTab = _sqlite3LocateTableItem(tls, pParse, uint32(isView), pName+8) + pTab = _sqlite3LocateTableItem(tls, pParse, uint32(uint32(isView)), pName+8) if noErr != 0 { (*Tsqlite3)(unsafe.Pointer(db)).FsuppressErr-- } @@ -98386,6 +98485,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -98454,7 +98554,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p i++ } } - pFKey = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + pFKey = _sqlite3DbMallocZero(tls, db, uint64(uint64(nByte))) if pFKey == uintptr(0) { goto fk_end } @@ -98520,7 +98620,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { _sqlite3RenameTokenRemap(tls, pParse, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*32))).FzEName) } - libc.Xmemcpy(tls, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*32))).FzEName, uint64(n)) + libc.Xmemcpy(tls, z, (*(*TExprList_item)(unsafe.Pointer(pToCol + 8 + uintptr(i)*32))).FzEName, uint64(uint64(n))) *(*int8)(unsafe.Pointer(z + uintptr(n))) = 0 z += uintptr(n + int32(1)) goto _4 @@ -98549,6 +98649,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -98586,7 +98687,7 @@ func _sqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { return } /* EV: R-30323-21917 */ - (*TFKey)(unsafe.Pointer(pFKey)).FisDeferred = uint8(isDeferred) + (*TFKey)(unsafe.Pointer(pFKey)).FisDeferred = uint8(uint8(isDeferred)) } // C documentation @@ -98631,7 +98732,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP return } if memRootPage >= 0 { - tnum = uint32(memRootPage) + tnum = uint32(uint32(memRootPage)) } else { tnum = (*TIndex)(unsafe.Pointer(pIndex)).Ftnum } @@ -98654,9 +98755,9 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iTab, addr1+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr1) if memRootPage < 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(tnum), iDb) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(int32(tnum)), iDb) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenWrite), iIdx, int32(tnum), iDb, pKey, -int32(8)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenWrite), iIdx, int32(int32(tnum)), iDb, pKey, -int32(8)) if memRootPage >= 0 { v7 = int32(OPFLAG_P2ISREG) } else { @@ -98714,20 +98815,20 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { var nByte int32 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = int32((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(8)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(2)*uint64(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*uint64(nCol)+uint64(1)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = int32((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(8)*uint64(uint64(nCol))+uint64(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(2)*uint64(int32(int32(nCol))+libc.Int32FromInt32(1))+uint64(2)*uint64(uint64(nCol))+uint64(1)*uint64(uint64(nCol))+uint64(7))&uint64(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ p = _sqlite3DbMallocZero(tls, db, uint64(nByte+nExtra)) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*uint64(nCol) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*uint64(uint64(nCol)) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * uint64(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * uint64(int32(int32(nCol))+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * uint64(nCol)) + pExtra += uintptr(uint64(2) * uint64(uint64(nCol))) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = uint16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = uint16(uint16(nCol)) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(int32(int32(nCol)) - int32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -98755,7 +98856,7 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i } if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags - if int32(sf) == 0 || int32(sf) == int32(3) { + if int32(int32(sf)) == 0 || int32(int32(sf)) == int32(3) { v2 = __ccgo_ts + 14154 } else { v2 = __ccgo_ts + 14160 @@ -98807,7 +98908,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } - if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) && int32(idxType) != int32(SQLITE_IDXTYPE_PRIMARYKEY) { + if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) && int32(int32(idxType)) != int32(SQLITE_IDXTYPE_PRIMARYKEY) { goto exit_create_index } if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { @@ -99013,9 +99114,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*uintptr)(unsafe.Pointer(bp + 104)) += uintptr(nName + int32(1)) libc.Xmemcpy(tls, (*TIndex)(unsafe.Pointer(pIndex)).FzName, zName, uint64(nName+int32(1))) (*TIndex)(unsafe.Pointer(pIndex)).FpTable = pTab - (*TIndex)(unsafe.Pointer(pIndex)).FonError = uint8(onError) + (*TIndex)(unsafe.Pointer(pIndex)).FonError = uint8(uint8(onError)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.BoolUint32(onError != libc.Int32FromInt32(OE_None)), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(idxType), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pIndex+100, uint32(uint32(idxType)), 0, 0x3) (*TIndex)(unsafe.Pointer(pIndex)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema (*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol = uint16((*TExprList)(unsafe.Pointer(pList)).FnExpr) if pPIWhere != 0 { @@ -99081,13 +99182,13 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } - *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) + *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(int16(j)) } zColl = uintptr(0) if int32((*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr)).Fop) == int32(TK_COLLATE) { zColl = *(*uintptr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8)) nColl = _sqlite3Strlen30(tls, zColl) + int32(1) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 104)), zColl, uint64(nColl)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 104)), zColl, uint64(uint64(nColl))) zColl = *(*uintptr)(unsafe.Pointer(bp + 104)) *(*uintptr)(unsafe.Pointer(bp + 104)) += uintptr(nColl) nExtra -= nColl @@ -99104,7 +99205,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8)) = zColl requestedSortOrder = int32((*TExprList_item)(unsafe.Pointer(pListItem)).Ffg.FsortFlags) & sortOrderMask - *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = uint8(requestedSortOrder) + *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = uint8(uint8(requestedSortOrder)) goto _6 _6: ; @@ -99125,7 +99226,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if _isDupColumn(tls, pIndex, int32((*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol), pPk, j) != 0 { (*TIndex)(unsafe.Pointer(pIndex)).FnColumn-- } else { - *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(x) + *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(int16(x)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FazColl + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8)) *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaSortOrder + uintptr(i))) = *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(j))) i++ @@ -99156,7 +99257,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(int16(j)))) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -99210,8 +99311,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError } } - if int32(idxType) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { - libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(idxType), 0, 0x3) + if int32(int32(idxType)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { + libc.SetBitFieldPtr16Uint32(pIdx+100, uint32(uint32(idxType)), 0, 0x3) } if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { (*TIndex)(unsafe.Pointer(pIndex)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpNewIndex @@ -99313,6 +99414,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -99397,7 +99499,7 @@ func _sqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { ** stat1 data to be ignored by the query planner. */ x = (*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst - if int32(x) < int32(99) { + if int32(int32(x)) < int32(99) { v2 = libc.Int16FromInt32(99) x = v2 (*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst = v2 @@ -99408,7 +99510,7 @@ func _sqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { *(*TLogEst)(unsafe.Pointer(a)) = x /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is ** 6 and each subsequent value (if any) is 5. */ - libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&_aVal)), uint64(nCopy)*uint64(2)) + libc.Xmemcpy(tls, a+1*2, uintptr(unsafe.Pointer(&_aVal)), uint64(uint64(nCopy))*uint64(2)) i = nCopy + int32(1) for { if !(i <= int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { @@ -99498,6 +99600,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -99538,7 +99641,7 @@ func _sqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in v2 = int64(2) * n } sz = v2 - pNew = _sqlite3DbRealloc(tls, db, pArray, uint64(sz*int64(szEntry))) + pNew = _sqlite3DbRealloc(tls, db, pArray, uint64(sz*int64(int64(szEntry)))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(pIdx)) = -int32(1) return pArray @@ -99546,7 +99649,7 @@ func _sqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in pArray = pNew } z = pArray - libc.Xmemset(tls, z+uintptr(n*int64(szEntry)), 0, uint64(szEntry)) + libc.Xmemset(tls, z+uintptr(n*int64(int64(szEntry))), 0, uint64(uint64(szEntry))) *(*int32)(unsafe.Pointer(pnEntry))++ return pArray } @@ -99570,7 +99673,7 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(24)+uint64((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(16)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(24)+uint64((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(16))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -99679,8 +99782,8 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra _, _, _, _ = db, i, nAlloc, pNew /* Sanity checking on calling parameters */ /* Allocate additional space if needed */ - if uint32((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc)+uint32(nExtra) > (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc { - nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) + if uint32((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc)+uint32(uint32(nExtra)) > (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc { + nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(int64(nExtra)) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) @@ -99694,7 +99797,7 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra return uintptr(0) } pSrc = pNew - (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc = uint32(nAlloc) + (*TSrcList)(unsafe.Pointer(pSrc)).FnAlloc = uint32(uint32(nAlloc)) } /* Move existing slots that come after the newly inserted slots ** out of the way */ @@ -99711,7 +99814,7 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra } *(*int32)(unsafe.Pointer(pSrc)) += nExtra /* Zero the newly allocated slots */ - libc.Xmemset(tls, pSrc+8+uintptr(iStart)*104, 0, uint64(104)*uint64(nExtra)) + libc.Xmemset(tls, pSrc+8+uintptr(iStart)*104, 0, uint64(104)*uint64(uint64(nExtra))) i = iStart for { if !(i < iStart+nExtra) { @@ -99956,6 +100059,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -100078,7 +100182,7 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { (*(*TSrcItem)(unsafe.Pointer(p + 8))).Ffg.Fjointype = uint8(0) /* All terms to the left of a RIGHT JOIN should be tagged with the ** JT_LTORJ flags */ - if int32(allFlags)&int32(JT_RIGHT) != 0 { + if int32(int32(allFlags))&int32(JT_RIGHT) != 0 { i = (*TSrcList)(unsafe.Pointer(p)).FnSrc - int32(1) for { if !(i > 0 && int32((*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*104))).Ffg.Fjointype)&int32(JT_RIGHT) == 0) { @@ -100384,8 +100488,8 @@ func _sqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onErro if onError == int32(OE_Abort) { _sqlite3MayAbort(tls, pParse) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), errCode, onError, 0, p4, int32(p4type)) - _sqlite3VdbeChangeP5(tls, v, uint16(p5Errmsg)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), errCode, onError, 0, p4, int32(int32(p4type))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(p5Errmsg))) } // C documentation @@ -100768,7 +100872,7 @@ func _sqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) } if pWith != 0 { nByte = int64(uint64(64) + uint64(48)*uint64((*TWith)(unsafe.Pointer(pWith)).FnCte)) - pNew = _sqlite3DbRealloc(tls, db, pWith, uint64(nByte)) + pNew = _sqlite3DbRealloc(tls, db, pWith, uint64(uint64(nByte))) } else { pNew = _sqlite3DbMallocZero(tls, db, uint64(64)) } @@ -100949,7 +101053,7 @@ func _findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ( pColl = _sqlite3HashFind(tls, db+648, zName) if uintptr(0) == pColl && create != 0 { nName = _sqlite3Strlen30(tls, zName) + int32(1) - pColl = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(3)*libc.Uint64FromInt64(40)+uint64(nName)) + pColl = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt32(3)*libc.Uint64FromInt64(40)+uint64(uint64(nName)))) if pColl != 0 { pDel = uintptr(0) (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName = pColl + 3*40 @@ -100958,7 +101062,7 @@ func _findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ( (*(*TCollSeq)(unsafe.Pointer(pColl + 1*40))).Fenc = uint8(SQLITE_UTF16LE) (*(*TCollSeq)(unsafe.Pointer(pColl + 2*40))).FzName = pColl + 3*40 (*(*TCollSeq)(unsafe.Pointer(pColl + 2*40))).Fenc = uint8(SQLITE_UTF16BE) - libc.Xmemcpy(tls, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, zName, uint64(nName)) + libc.Xmemcpy(tls, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, zName, uint64(uint64(nName))) pDel = _sqlite3HashInsert(tls, db+648, (*(*TCollSeq)(unsafe.Pointer(pColl))).FzName, pColl) /* If a malloc() failure occurred in sqlite3HashInsert(), it will ** return the pColl pointer to be deleted (because it wasn't added @@ -100997,7 +101101,7 @@ func _sqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc Tu8, zName uintptr, crea if zName != 0 { pColl = _findCollSeqEntry(tls, db, zName, create) if pColl != 0 { - pColl += uintptr(int32(enc)-int32(1)) * 40 + pColl += uintptr(int32(int32(enc))-int32(1)) * 40 } } else { pColl = (*Tsqlite3)(unsafe.Pointer(db)).FpDfltColl @@ -101050,7 +101154,7 @@ func _sqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc Tu8, pColl uintptr, z /* No collation sequence of this type for this encoding is registered. ** Call the collation factory to see if it can supply us with one. */ - _callCollNeeded(tls, db, int32(enc), zName) + _callCollNeeded(tls, db, int32(int32(enc)), zName) p = _sqlite3FindCollSeq(tls, db, enc, zName, 0) } if p != 0 && !((*TCollSeq)(unsafe.Pointer(p)).FxCmp != 0) && _synthCollSeq(tls, db, p) != 0 { @@ -101092,7 +101196,7 @@ func _sqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) (r uint db = (*TParse)(unsafe.Pointer(pParse)).Fdb enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc initbusy = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy - pColl = _sqlite3FindCollSeq(tls, db, enc, zName, int32(initbusy)) + pColl = _sqlite3FindCollSeq(tls, db, enc, zName, int32(int32(initbusy))) if !(initbusy != 0) && (!(pColl != 0) || !((*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0)) { pColl = _sqlite3GetCollSeq(tls, pParse, enc, pColl, zName) } @@ -101154,10 +101258,10 @@ func _matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc Tu8) (r int32) { match = int32(1) } /* Bonus points if the text encoding matches */ - if uint32(enc) == (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) { + if uint32(uint32(enc)) == (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) { match += int32(2) /* Exact encoding match */ } else { - if uint32(enc)&(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(2) != uint32(0) { + if uint32(uint32(enc))&(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(2) != uint32(0) { match += int32(1) /* Both are UTF16, but with different byte orders */ } } @@ -101292,13 +101396,13 @@ func _sqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, ** new entry to the hash table and return it. */ if v2 = createFlag != 0 && bestScore < int32(FUNC_PERFECT_MATCH); v2 { - v1 = _sqlite3DbMallocZero(tls, db, uint64(72)+uint64(nName)+uint64(1)) + v1 = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+uint64(uint64(nName))+uint64(1))) pBest = v1 } if v2 && v1 != uintptr(0) { (*TFuncDef)(unsafe.Pointer(pBest)).FzName = pBest + 1*72 - (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = int8(uint16(nArg)) - (*TFuncDef)(unsafe.Pointer(pBest)).FfuncFlags = uint32(enc) + (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = int8(uint16(uint16(nArg))) + (*TFuncDef)(unsafe.Pointer(pBest)).FfuncFlags = uint32(uint32(enc)) libc.Xmemcpy(tls, pBest+1*72, zName, uint64(nName+int32(1))) z = (*TFuncDef)(unsafe.Pointer(pBest)).FzName for { @@ -101787,12 +101891,12 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = int16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk) + *(*int32)(unsafe.Pointer(pParse + 56)) += int32(int32(nPk)) v15 = pParse + 52 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ iEphCur = v14 - addrEphOpen = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), iEphCur, int32(nPk)) + addrEphOpen = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), iEphCur, int32(int32(nPk))) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk) } /* Construct a query to find the rowid or primary key for every row @@ -101822,7 +101926,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if pPk != 0 { i = 0 for { - if !(i < int32(nPk)) { + if !(i < int32(int32(nPk))) { break } _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i) @@ -101869,8 +101973,8 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere v19 = *(*int32)(unsafe.Pointer(v20)) iKey = v19 nKey = 0 /* Zero tells OP_Found to use a composite key */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), iPk, int32(nPk), iKey, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(nPk)) - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iEphCur, iKey, iPk, int32(nPk)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), iPk, int32(int32(nPk)), iKey, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(int32(nPk))) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iEphCur, iKey, iPk, int32(int32(nPk))) } else { /* Add the rowid of the row to be deleted to the RowSet */ nKey = int16(1) /* OP_DeferredSeek always uses a single rowid */ @@ -101899,7 +102003,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if eOnePass != ONEPASS_OFF { /* OP_Found will use an unpacked key */ if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(*(*int32)(unsafe.Pointer(bp))-iTabCur))) != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), *(*int32)(unsafe.Pointer(bp)), addrBypass, iKey, int32(nKey)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), *(*int32)(unsafe.Pointer(bp)), addrBypass, iKey, int32(int32(nKey))) } } else { if pPk != 0 { @@ -101929,7 +102033,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere _sqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) } else { count = libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0) /* True to count changes */ - _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), (*(*[2]int32)(unsafe.Pointer(bp + 80)))[int32(1)]) + _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), iKey, nKey, uint8(uint8(count)), uint8(OE_Default), uint8(uint8(eOnePass)), (*(*[2]int32)(unsafe.Pointer(bp + 80)))[int32(1)]) } /* End of the loop over all rowids/primary-keys. */ if eOnePass != ONEPASS_OFF { @@ -101959,6 +102063,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15213) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -102036,15 +102141,15 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri v1 = int32(OP_NotFound) } opSeek = uint8(v1) - if int32(eMode) == ONEPASS_OFF { - _sqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) + if int32(int32(eMode)) == ONEPASS_OFF { + _sqlite3VdbeAddOp4Int(tls, v, int32(int32(opSeek)), iDataCur, iLabel, iPk, int32(int32(nPk))) } /* If there are any triggers to fire, allocate a range of registers to ** use for the old.* references in the triggers. */ if _sqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0 || pTrigger != 0 { /* Start of BEFORE trigger programs */ /* TODO: Could use temporary registers here. Also could attempt to ** avoid copying the contents of the rowid register. */ - mask = _sqlite3TriggerColmask(tls, pParse, pTrigger, uintptr(0), 0, libc.Int32FromInt32(TRIGGER_BEFORE)|libc.Int32FromInt32(TRIGGER_AFTER), pTab, int32(onconf)) + mask = _sqlite3TriggerColmask(tls, pParse, pTrigger, uintptr(0), 0, libc.Int32FromInt32(TRIGGER_BEFORE)|libc.Int32FromInt32(TRIGGER_AFTER), pTab, int32(int32(onconf))) mask |= _sqlite3FkOldmask(tls, pParse, pTab) iOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) *(*int32)(unsafe.Pointer(pParse + 56)) += int32(1) + int32((*TTable)(unsafe.Pointer(pTab)).FnCol) @@ -102057,7 +102162,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri break } if mask == uint32(0xffffffff) || iCol <= int32(31) && mask&(libc.Uint32FromInt32(1)<= 0 && iIdxNoSeek != iDataCur { _sqlite3VdbeAddOp1(tls, v, int32(OP_Delete), iIdxNoSeek) } - if int32(eMode) == int32(ONEPASS_MULTI) { + if int32(int32(eMode)) == int32(ONEPASS_MULTI) { p5 = Tu8(int32(p5) | libc.Int32FromInt32(OPFLAG_SAVEPOSITION)) } - _sqlite3VdbeChangeP5(tls, v, uint16(p5)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(p5))) } /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key @@ -102124,7 +102229,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri _sqlite3FkActions(tls, pParse, pTab, uintptr(0), iOld, uintptr(0), 0) /* Invoke AFTER DELETE trigger programs. */ if pTrigger != 0 { - _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_AFTER), pTab, iOld, int32(onconf), iLabel) + _sqlite3CodeRowTrigger(tls, pParse, pTrigger, int32(TK_DELETE), uintptr(0), int32(TRIGGER_AFTER), pTab, iOld, int32(int32(onconf)), iLabel) } /* Jump here if the row had already been deleted before any BEFORE ** trigger programs were invoked. Or if a trigger program throws a @@ -102456,14 +102561,14 @@ func _lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { break } z++ - if int32(c) >= int32(0xc0) { + if int32(int32(c)) >= int32(0xc0) { for int32(*(*uint8)(unsafe.Pointer(z)))&int32(0xc0) == int32(0x80) { z++ z0++ } } } - Xsqlite3_result_int(tls, context, int32(int64(z)-int64(z0))) + Xsqlite3_result_int(tls, context, int32(int64(int64(z))-int64(int64(z0)))) default: Xsqlite3_result_null(tls, context) break @@ -102609,7 +102714,7 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { goto endInstrOOM } firstChar = *(*uint8)(unsafe.Pointer(zNeedle)) - for nNeedle <= nHaystack && (int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(firstChar) || libc.Xmemcmp(tls, zHaystack, zNeedle, uint64(nNeedle)) != 0) { + for nNeedle <= nHaystack && (int32(*(*uint8)(unsafe.Pointer(zHaystack))) != int32(int32(firstChar)) || libc.Xmemcmp(tls, zHaystack, zNeedle, uint64(uint64(nNeedle))) != 0) { N++ for cond := true; cond; cond = isText != 0 && int32(*(*uint8)(unsafe.Pointer(zHaystack)))&int32(0xc0) == int32(0x80) { nHaystack-- @@ -102621,11 +102726,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -102730,7 +102837,7 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { p2 = int64(*(*int32)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context) + 136))) } if p1 < 0 { - p1 += int64(len1) + p1 += int64(int64(len1)) if p1 < 0 { p2 += p1 if p2 < 0 { @@ -102782,15 +102889,15 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ; p2-- } - Xsqlite3_result_text64(tls, context, z, uint64(int64(z2)-int64(z)), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, uint64(int64(int64(z2))-int64(int64(z))), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) } else { - if p1+p2 > int64(len1) { - p2 = int64(len1) - p1 + if p1+p2 > int64(int64(len1)) { + p2 = int64(int64(len1)) - p1 if p2 < 0 { p2 = 0 } } - Xsqlite3_result_blob64(tls, context, z+uintptr(p1), uint64(p2), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_blob64(tls, context, z+uintptr(p1), uint64(uint64(p2)), uintptr(-libc.Int32FromInt32(1))) } } @@ -102868,7 +102975,7 @@ func _contextMalloc(tls *libc.TLS, context uintptr, nByte Ti64) (r uintptr) { Xsqlite3_result_error_toobig(tls, context) z = uintptr(0) } else { - z = _sqlite3Malloc(tls, uint64(nByte)) + z = _sqlite3Malloc(tls, uint64(uint64(nByte))) if !(z != 0) { Xsqlite3_result_error_nomem(tls, context) } @@ -102890,7 +102997,7 @@ func _upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) /* Verify that the call to _bytes() does not invalidate the _text() pointer */ if z2 != 0 { - z1 = _contextMalloc(tls, context, int64(n)+int64(1)) + z1 = _contextMalloc(tls, context, int64(int64(n))+int64(1)) if z1 != 0 { i = 0 for { @@ -102917,7 +103024,7 @@ func _lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) /* Verify that the call to _bytes() does not invalidate the _text() pointer */ if z2 != 0 { - z1 = _contextMalloc(tls, context, int64(n)+int64(1)) + z1 = _contextMalloc(tls, context, int64(int64(n))+int64(1)) if z1 != 0 { i = 0 for { @@ -102987,8 +103094,8 @@ func _randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } p = _contextMalloc(tls, context, n) if p != 0 { - Xsqlite3_randomness(tls, int32(n), p) - Xsqlite3_result_blob(tls, context, p, int32(n), __ccgo_fp(Xsqlite3_free)) + Xsqlite3_randomness(tls, int32(int32(n)), p) + Xsqlite3_result_blob(tls, context, p, int32(int32(n)), __ccgo_fp(Xsqlite3_free)) } } @@ -103228,7 +103335,7 @@ func _patternCompare(tls *libc.TLS, _zPattern uintptr, _zString uintptr, pInfo u (*(*[3]int8)(unsafe.Pointer(bp + 18)))[int32(1)] = int8(_sqlite3UpperToLower[uint8(c)]) (*(*[3]int8)(unsafe.Pointer(bp + 18)))[int32(2)] = 0 } else { - (*(*[3]int8)(unsafe.Pointer(bp + 18)))[0] = int8(c) + (*(*[3]int8)(unsafe.Pointer(bp + 18)))[0] = int8(int8(c)) (*(*[3]int8)(unsafe.Pointer(bp + 18)))[int32(1)] = 0 } for int32(1) != 0 { @@ -103620,7 +103727,7 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { zText = (*TStrAccum)(unsafe.Pointer(pStr)).FzText i = 0 for { - if !(int64(i) < nBlob) { + if !(int64(int64(i)) < nBlob) { break } *(*int8)(unsafe.Pointer(zText + uintptr(i*int32(2)+int32(2)))) = _hexdigits[int32(*(*int8)(unsafe.Pointer(zBlob + uintptr(i))))>>int32(4)&int32(0x0F)] @@ -103766,7 +103873,7 @@ func _charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { i++ } *(*uint8)(unsafe.Pointer(zOut)) = uint8(0) - Xsqlite3_result_text64(tls, context, z, uint64(int64(zOut)-int64(z)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, uint64(int64(int64(zOut))-int64(int64(z))), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } // C documentation @@ -103784,7 +103891,7 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { pBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) /* No encoding change */ - v1 = _contextMalloc(tls, context, int64(n)*int64(2)+int64(1)) + v1 = _contextMalloc(tls, context, int64(int64(n))*int64(2)+int64(1)) zHex = v1 z = v1 if zHex != 0 { @@ -103796,10 +103903,10 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { c = *(*uint8)(unsafe.Pointer(pBlob)) v3 = z z++ - *(*int8)(unsafe.Pointer(v3)) = _hexdigits[int32(c)>>int32(4)&int32(0xf)] + *(*int8)(unsafe.Pointer(v3)) = _hexdigits[int32(int32(c))>>int32(4)&int32(0xf)] v4 = z z++ - *(*int8)(unsafe.Pointer(v4)) = _hexdigits[int32(c)&int32(0xf)] + *(*int8)(unsafe.Pointer(v4)) = _hexdigits[int32(int32(c))&int32(0xf)] goto _2 _2: ; @@ -103807,7 +103914,7 @@ func _hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { pBlob++ } *(*int8)(unsafe.Pointer(z)) = 0 - Xsqlite3_result_text64(tls, context, zHex, uint64(int64(z)-int64(zHex)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, zHex, uint64(int64(int64(z))-int64(int64(zHex))), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } } @@ -103913,7 +104020,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { goto unhex_null } c = *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) - if int32(c) == 0x00 { + if int32(int32(c)) == 0x00 { goto unhex_done } } @@ -103926,13 +104033,15 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { } v6 = p p++ - *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))< 0 { - azChar = _contextMalloc(tls, context, int64(uint64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, int64(uint64(int64(int64(nChar)))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -104118,7 +104227,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { z++ } } - *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = uint32(int64(z) - int64(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*8)))) + *(*uint32)(unsafe.Pointer(aLen + uintptr(nChar)*4)) = uint32(int64(int64(z)) - int64(*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*8)))) goto _4 _4: ; @@ -104138,7 +104247,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { break } len1 = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4)) - if len1 <= nIn && libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len1)) == 0 { + if len1 <= nIn && libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(uint64(len1))) == 0 { break } goto _6 @@ -104162,7 +104271,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { break } len11 = *(*uint32)(unsafe.Pointer(aLen + uintptr(i)*4)) - if len11 <= nIn && libc.Xmemcmp(tls, zIn+uintptr(nIn-len11), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len11)) == 0 { + if len11 <= nIn && libc.Xmemcmp(tls, zIn+uintptr(nIn-len11), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(uint64(len11))) == 0 { break } goto _7 @@ -104180,7 +104289,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { Xsqlite3_free(tls, azChar) } } - Xsqlite3_result_text(tls, context, zIn, int32(nIn), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, context, zIn, int32(int32(nIn)), uintptr(-libc.Int32FromInt32(1))) } var _lenOne = [1]uint32{ @@ -104233,10 +104342,10 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { - libc.Xmemcpy(tls, z+uintptr(j), zSep, uint64(nSep)) - j += int64(nSep) + libc.Xmemcpy(tls, z+uintptr(j), zSep, uint64(uint64(nSep))) + j += int64(int64(nSep)) } - libc.Xmemcpy(tls, z+uintptr(j), v, uint64(k)) + libc.Xmemcpy(tls, z+uintptr(j), v, uint64(uint64(k))) j += k } } @@ -104246,7 +104355,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n i++ } *(*int8)(unsafe.Pointer(z + uintptr(j))) = 0 - Xsqlite3_result_text64(tls, context, z, uint64(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, context, z, uint64(uint64(j)), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) } // C documentation @@ -104324,8 +104433,8 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } code = int32(_iCode[int32(*(*Tu8)(unsafe.Pointer(zIn + uintptr(i))))&int32(0x7f)]) if code > 0 { - if code != int32(prevcode) { - prevcode = uint8(code) + if code != int32(int32(prevcode)) { + prevcode = uint8(uint8(code)) v3 = j j++ (*(*[8]int8)(unsafe.Pointer(bp)))[v3] = int8(code + int32('0')) @@ -104485,10 +104594,10 @@ func _kahanBabuskaNeumaierStepInt64(tls *libc.TLS, pSum uintptr, iVal Ti64) { if iVal <= -int64(4503599627370496) || iVal >= +libc.Int64FromInt64(4503599627370496) { iSm = iVal % int64(16384) iBig = iVal - iSm - _kahanBabuskaNeumaierStep(tls, pSum, float64(iBig)) - _kahanBabuskaNeumaierStep(tls, pSum, float64(iSm)) + _kahanBabuskaNeumaierStep(tls, pSum, float64(float64(iBig))) + _kahanBabuskaNeumaierStep(tls, pSum, float64(float64(iSm))) } else { - _kahanBabuskaNeumaierStep(tls, pSum, float64(iVal)) + _kahanBabuskaNeumaierStep(tls, pSum, float64(float64(iVal))) } } @@ -104503,9 +104612,9 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { if iVal <= -int64(4503599627370496) || iVal >= +libc.Int64FromInt64(4503599627370496) { iSm = iVal % int64(16384) (*TSumCtx)(unsafe.Pointer(p)).FrSum = float64(iVal - iSm) - (*TSumCtx)(unsafe.Pointer(p)).FrErr = float64(iSm) + (*TSumCtx)(unsafe.Pointer(p)).FrErr = float64(float64(iSm)) } else { - (*TSumCtx)(unsafe.Pointer(p)).FrSum = float64(iVal) + (*TSumCtx)(unsafe.Pointer(p)).FrSum = float64(float64(iVal)) (*TSumCtx)(unsafe.Pointer(p)).FrErr = float64(0) } } @@ -104826,7 +104935,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, uint64((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(uint64((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -104837,7 +104946,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, uint64((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(uint64((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -104890,7 +104999,7 @@ func _groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintpt if nVS >= int32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar) { (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar = uint32(0) } else { - (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar -= uint32(nVS) + (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar -= uint32(uint32(nVS)) libc.Xmemmove(tls, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText, (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FzText+uintptr(nVS), uint64((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar)) } if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).Fstr.FnChar == uint32(0) { @@ -104971,7 +105080,7 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 } _sqlite3CreateFunc(tls, db, __ccgo_ts+15357, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15357, nArg, uint8(SQLITE_UTF8), uint8(0)) - *(*Tu32)(unsafe.Pointer(pDef + 4)) |= uint32(flags) + *(*Tu32)(unsafe.Pointer(pDef + 4)) |= uint32(uint32(flags)) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= uint32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 _1: @@ -106215,7 +106324,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(uint64(nCol))*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -106258,7 +106367,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey break } iCol = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2)) /* Name of indexed column */ - if int32(iCol) < 0 { + if int32(int32(iCol)) < 0 { break } /* No foreign keys against expression indexes */ /* If the index uses a collation sequence that is different from @@ -106484,7 +106593,7 @@ func _exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int db = (*TParse)(unsafe.Pointer(pParse)).Fdb pExpr = _sqlite3Expr(tls, db, int32(TK_REGISTER), uintptr(0)) if pExpr != 0 { - if int32(iCol) >= 0 && int32(iCol) != int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + if int32(int32(iCol)) >= 0 && int32(int32(iCol)) != int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 (*TExpr)(unsafe.Pointer(pExpr)).FiTable = regBase + int32(_sqlite3TableColumnToStorage(tls, pTab, iCol)) + int32(1) (*TExpr)(unsafe.Pointer(pExpr)).FaffExpr = (*TColumn)(unsafe.Pointer(pCol)).Faffinity @@ -107030,7 +107139,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, break } iFromCol = (*(*TsColMap)(unsafe.Pointer(pFKey + 64 + uintptr(i)*16))).FiFrom - iReg = int32(_sqlite3TableColumnToStorage(tls, (*TFKey)(unsafe.Pointer(pFKey)).FpFrom, int16(iFromCol))) + regOld + int32(1) + iReg = int32(_sqlite3TableColumnToStorage(tls, (*TFKey)(unsafe.Pointer(pFKey)).FpFrom, int16(int16(iFromCol)))) + regOld + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), iReg, iJump) goto _2 _2: @@ -107502,13 +107611,13 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+uint64(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+uint64(uint64(nFrom))+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 pStep = v4 (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget = pStep + 1*96 - libc.Xmemcpy(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint64(nFrom)) + libc.Xmemcpy(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint64(uint64(nFrom))) (*TTriggerStep)(unsafe.Pointer(pStep)).FpWhere = _sqlite3ExprDup(tls, db, pWhere, int32(EXPRDUP_REDUCE)) (*TTriggerStep)(unsafe.Pointer(pStep)).FpExprList = _sqlite3ExprListDup(tls, db, pList, int32(EXPRDUP_REDUCE)) (*TTriggerStep)(unsafe.Pointer(pStep)).FpSelect = _sqlite3SelectDup(tls, db, pSelect, int32(EXPRDUP_REDUCE)) @@ -107734,19 +107843,19 @@ func _computeIndexAffStr(tls *libc.TLS, db uintptr, pIdx uintptr) (r uintptr) { break } x = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) - if int32(x) >= 0 { + if int32(int32(x)) >= 0 { aff = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*16))).Faffinity } else { - if int32(x) == -int32(1) { + if int32(int32(x)) == -int32(1) { aff = int8(SQLITE_AFF_INTEGER) } else { aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(n)*32))).FpExpr) } } - if int32(aff) < int32(SQLITE_AFF_BLOB) { + if int32(int32(aff)) < int32(SQLITE_AFF_BLOB) { aff = int8(SQLITE_AFF_BLOB) } - if int32(aff) > int32(SQLITE_AFF_NUMERIC) { + if int32(int32(aff)) > int32(SQLITE_AFF_NUMERIC) { aff = int8(SQLITE_AFF_NUMERIC) } *(*int8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff @@ -108056,7 +108165,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in goto _5 } eProgress = int32(1) - x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore + x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(i)))) + iRegStore _sqlite3ExprCodeGeneratedColumn(tls, pParse, pTab, pCol, x) p8 = pCol + 14 *(*Tu16)(unsafe.Pointer(p8)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p8))) & ^libc.Int32FromInt32(COLFLAG_NOTAVAIL)) @@ -108137,7 +108246,7 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in v3 = pToplevel + 56 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) - (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ + (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ *(*int32)(unsafe.Pointer(pToplevel + 56)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr @@ -108745,7 +108854,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* If this is not a view, open the table and and all indices */ if !(isView != 0) { nIdx = _sqlite3OpenTableAndIndices(tls, pParse, pTab, int32(OP_OpenWrite), uint8(0), -int32(1), uintptr(0), bp, bp+4) - aRegIdx = _sqlite3DbMallocRawNN(tls, db, uint64(4)*uint64(nIdx+libc.Int32FromInt32(2))) + aRegIdx = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*uint64(nIdx+libc.Int32FromInt32(2)))) if aRegIdx == uintptr(0) { goto insert_cleanup } @@ -109051,7 +109160,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ - _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, 0, libc.BoolUint8(ipkColumn >= 0), uint8(onError), endOfLoop, bp+112, uintptr(0), pUpsert) + _sqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, 0, libc.BoolUint8(ipkColumn >= 0), uint8(uint8(onError)), endOfLoop, bp+112, uintptr(0), pUpsert) if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ForeignKeys) != 0 { _sqlite3FkCheck(tls, pParse, pTab, 0, regIns, uintptr(0), 0) } @@ -109064,7 +109173,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT ** functionality. */ bUseSeek = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 112)) == 0 || !(_sqlite3VdbeHasSubProgram(tls, v) != 0)) - _sqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, aRegIdx, 0, int32(appendFlag), bUseSeek) + _sqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), regIns, aRegIdx, 0, int32(int32(appendFlag)), bUseSeek) } } /* Update the count of rows that are inserted @@ -109090,6 +109199,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VdbeJumpHere(tls, v, addrInsTop) } } + goto insert_end insert_end: ; /* Update the sqlite_sequence table by storing the content of the @@ -109107,6 +109217,7 @@ insert_end: if regRowCount != 0 { _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16305) } + goto insert_cleanup insert_cleanup: ; _sqlite3SrcListDelete(tls, db, pTabList) @@ -109467,8 +109578,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt /* Do not check NOT NULL on columns that do not change */ goto _1 } - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + if int32(int32(overrideError)) != int32(OE_Default) { + onError = int32(int32(overrideError)) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) @@ -109484,7 +109595,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt goto _1 } } - iReg = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(i))) + regNewData + int32(1) + iReg = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(i)))) + regNewData + int32(1) switch onError { case int32(OE_Replace): addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_NotNull), iReg) @@ -109534,8 +109645,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if (*TTable)(unsafe.Pointer(pTab)).FpCheck != 0 && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_IgnoreChecks) == uint64(0) { pCheck = (*TTable)(unsafe.Pointer(pTab)).FpCheck (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + int32(1)) - if int32(overrideError) != int32(OE_Default) { - v2 = int32(overrideError) + if int32(int32(overrideError)) != int32(OE_Default) { + v2 = int32(int32(overrideError)) } else { v2 = int32(OE_Abort) } @@ -109546,12 +109657,12 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } pExpr = (*(*TExprList_item)(unsafe.Pointer(pCheck + 8 + uintptr(i)*32))).FpExpr - if aiChng != 0 && !(_sqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, int32(pkChng)) != 0) { + if aiChng != 0 && !(_sqlite3ExprReferencesUpdatedColumn(tls, pExpr, aiChng, int32(int32(pkChng))) != 0) { /* The check constraints do not reference any of the columns being ** updated so there is no point it verifying the check constraint */ goto _3 } - if int32(bAffinityDone) == 0 { + if int32(int32(bAffinityDone)) == 0 { _sqlite3TableAffinity(tls, v, pTab, regNewData+int32(1)) bAffinityDone = uint8(1) } @@ -109638,7 +109749,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } (*(*TIndexIterator)(unsafe.Pointer(bp + 8))).FeType = int32(1) *(*int32)(unsafe.Pointer(bp + 8 + 8)) = nIdx - nByte = (libc.Uint64FromInt64(16)+libc.Uint64FromInt32(1))*uint64(nIdx) + uint64(nIdx) + nByte = uint64((libc.Uint64FromInt64(16)+libc.Uint64FromInt32(1))*uint64(uint64(nIdx)) + uint64(uint64(nIdx))) *(*uintptr)(unsafe.Pointer(bp + 8 + 8 + 8)) = _sqlite3DbMallocZero(tls, db, nByte) if *(*uintptr)(unsafe.Pointer(bp + 8 + 8 + 8)) == uintptr(0) { return @@ -109748,8 +109859,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt addrRowidOk = _sqlite3VdbeMakeLabel(tls, pParse) /* Figure out what action to take in case of a rowid collision */ onError = int32((*TTable)(unsafe.Pointer(pTab)).FkeyConf) - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + if int32(int32(overrideError)) != int32(OE_Default) { + onError = int32(int32(overrideError)) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) @@ -109777,7 +109888,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** to defer the running of the rowid conflict checking until after ** the UNIQUE constraints have run. */ - if onError == int32(OE_Replace) && onError != int32(overrideError) && (*TTable)(unsafe.Pointer(pTab)).FpIndex != 0 && !(upsertIpkDelay != 0) { + if onError == int32(OE_Replace) && onError != int32(int32(overrideError)) && (*TTable)(unsafe.Pointer(pTab)).FpIndex != 0 && !(upsertIpkDelay != 0) { ipkTop = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) + int32(1) } if isUpdate != 0 { @@ -109880,7 +109991,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } } addrUniqueOk = _sqlite3VdbeMakeLabel(tls, pParse) - if int32(bAffinityDone) == 0 { + if int32(int32(bAffinityDone)) == 0 { _sqlite3TableAffinity(tls, v, pTab, regNewData+int32(1)) bAffinityDone = uint8(1) } @@ -109911,7 +110022,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt x = regNewData _sqlite3VdbeAddOp2(tls, v, int32(OP_IntCopy), x, regIdx+i) } else { - x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData + int32(1) + x = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(iField)))) + regNewData + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), x, regIdx+i) } } @@ -109925,7 +110036,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt ** of a WITHOUT ROWID table and there has been no change the ** primary key, then no collision is possible. The collision detection ** logic below can all be skipped. */ - if isUpdate != 0 && pPk == pIdx && int32(pkChng) == 0 { + if isUpdate != 0 && pPk == pIdx && int32(int32(pkChng)) == 0 { _sqlite3VdbeResolveLabel(tls, v, addrUniqueOk) goto _9 } @@ -109935,8 +110046,8 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt _sqlite3VdbeResolveLabel(tls, v, addrUniqueOk) goto _9 /* pIdx is not a UNIQUE index */ } - if int32(overrideError) != int32(OE_Default) { - onError = int32(overrideError) + if int32(int32(overrideError)) != int32(OE_Default) { + onError = int32(int32(overrideError)) } else { if onError == int32(OE_Default) { onError = int32(OE_Abort) @@ -110022,7 +110133,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt addrJump = addrUniqueOk op = int32(OP_Eq) } - x1 = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(x1))) + x1 = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(x1)))) _sqlite3VdbeAddOp4(tls, v, op, regOldData+int32(1)+x1, addrJump, regCmp+i, p4, -int32(2)) _sqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) goto _14 @@ -110060,7 +110171,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } else { v15 = ONEPASS_OFF } - _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, regR, int16(nPkField), uint8(0), uint8(OE_Replace), uint8(v15), iThisCur) + _sqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, regR, int16(int16(nPkField)), uint8(0), uint8(OE_Replace), uint8(v15), iThisCur) if pTrigger != 0 && isUpdate != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_CursorUnlock), iDataCur) } @@ -110225,7 +110336,7 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat v3 = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iIdxCur+i, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))+int32(1), v3) - _sqlite3VdbeChangeP5(tls, v, uint16(pik_flags)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(pik_flags))) goto _1 _1: ; @@ -110256,7 +110367,7 @@ func _sqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDat if !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { _sqlite3VdbeAppendP4(tls, v, pTab, -int32(5)) } - _sqlite3VdbeChangeP5(tls, v, uint16(pik_flags)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(pik_flags))) } // C documentation @@ -110328,7 +110439,7 @@ func _sqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if aToOpen == uintptr(0) || *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(i+int32(1)))) != 0 { _sqlite3VdbeAddOp3(tls, v, op, iIdxCur, int32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) - _sqlite3VdbeChangeP5(tls, v, uint16(p5)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(p5))) } goto _3 _3: @@ -110698,7 +110809,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { _sqlite3VdbeChangeP4(tls, v, -int32(1), pDest, -int32(5)) } - _sqlite3VdbeChangeP5(tls, v, uint16(insFlags)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(insFlags))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iSrc, addr1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Close), iSrc, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_Close), iDest, 0) @@ -110770,14 +110881,14 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin idxInsFlags = Tu8(int32(idxInsFlags) | libc.Int32FromInt32(OPFLAG_NCHANGE)) } } - if int32(idxInsFlags) != libc.Int32FromInt32(OPFLAG_USESEEKRESULT)|libc.Int32FromInt32(OPFLAG_PREFORMAT) { + if int32(int32(idxInsFlags)) != libc.Int32FromInt32(OPFLAG_USESEEKRESULT)|libc.Int32FromInt32(OPFLAG_PREFORMAT) { _sqlite3VdbeAddOp3(tls, v, int32(OP_RowData), iSrc, regData, int32(1)) if (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) && !((*TTable)(unsafe.Pointer(pDest)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pDestIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { _codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData) } } _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxInsert), iDest, regData) - _sqlite3VdbeChangeP5(tls, v, uint16(int32(idxInsFlags)|int32(OPFLAG_APPEND))) + _sqlite3VdbeChangeP5(tls, v, uint16(int32(int32(idxInsFlags))|int32(OPFLAG_APPEND))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iSrc, addr1+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Close), iSrc, 0) @@ -110876,7 +110987,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c if xCallback != 0 && (int32(SQLITE_ROW) == rc || int32(SQLITE_DONE) == rc && !(callbackIsInit != 0) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_NullCallback) != 0) { if !(callbackIsInit != 0) { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) - azCols = _sqlite3DbMallocRaw(tls, db, uint64(libc.Int32FromInt32(2)*nCol+libc.Int32FromInt32(1))*uint64(8)) + azCols = _sqlite3DbMallocRaw(tls, db, uint64(uint64(libc.Int32FromInt32(2)*nCol+libc.Int32FromInt32(1))*uint64(8))) if azCols == uintptr(0) { goto exec_out } @@ -110938,6 +111049,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c _sqlite3DbFree(tls, db, azCols) azCols = uintptr(0) } + goto exec_out exec_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -111638,7 +111750,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp pVfs = (*Tsqlite3)(unsafe.Pointer(db)).FpVfs *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zAltEntry = uintptr(0) - nMsg = libc.Xstrlen(tls, zFile) + nMsg = uint64(libc.Xstrlen(tls, zFile)) if pzErrMsg != 0 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = uintptr(0) } @@ -111687,7 +111799,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp if zAltFile == uintptr(0) { return int32(SQLITE_NOMEM) } - if nMsg+libc.Xstrlen(tls, _azEndings[ii])+uint64(1) <= uint64(FILENAME_MAX) { + if nMsg+uint64(libc.Xstrlen(tls, _azEndings[ii]))+uint64(1) <= uint64(FILENAME_MAX) { handle = _sqlite3OsDlOpen(tls, pVfs, zAltFile) } Xsqlite3_free(tls, zAltFile) @@ -111743,7 +111855,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x02) != 0 { v6 = iEntry iEntry++ - *(*int8)(unsafe.Pointer(zAltEntry + uintptr(v6))) = int8(_sqlite3UpperToLower[uint32(c)]) + *(*int8)(unsafe.Pointer(zAltEntry + uintptr(v6))) = int8(_sqlite3UpperToLower[uint32(uint32(c))]) } goto _4 _4: @@ -111756,13 +111868,13 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16364, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, int32(int32(nMsg)), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16364, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -111784,7 +111896,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*uint64((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*uint64((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -111798,6 +111910,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*int32)(unsafe.Pointer(v9))++ *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaExtension + uintptr(v8)*8)) = handle return SQLITE_OK + goto extension_not_found extension_not_found: ; if pzErrMsg != 0 { @@ -111807,7 +111920,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16439, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, int32(int32(nMsg)), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16439, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -111934,7 +112047,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { i++ } if i == _sqlite3Autoext.FnExt { - nByte = uint64(_sqlite3Autoext.FnExt+libc.Uint32FromInt32(1)) * uint64(8) + nByte = uint64(uint64(_sqlite3Autoext.FnExt+libc.Uint32FromInt32(1)) * uint64(8)) aNew = Xsqlite3_realloc64(tls, _sqlite3Autoext.FaExt, nByte) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -112760,7 +112873,7 @@ func _changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) (r if _invalidateTempStorage(tls, pParse) != SQLITE_OK { return int32(SQLITE_ERROR) } - (*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store = uint8(ts) + (*Tsqlite3)(unsafe.Pointer(db)).Ftemp_store = uint8(uint8(ts)) return SQLITE_OK } @@ -112774,19 +112887,19 @@ func _setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { var n Tu8 _, _, _, _ = i, j, n, v1 n = (*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName - if int32(n) == 0 { + if int32(int32(n)) == 0 { v1 = int32(1) } else { - v1 = int32(n) + v1 = int32(int32(n)) } _sqlite3VdbeSetNumCols(tls, v, v1) - if int32(n) == 0 { + if int32(int32(n)) == 0 { _sqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName, libc.UintptrFromInt32(0)) } else { i = 0 j = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { - if !(i < int32(n)) { + if !(i < int32(int32(n))) { break } _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, _pragCName[j], libc.UintptrFromInt32(0)) @@ -112859,7 +112972,7 @@ func _setAllPagerFlags(tls *libc.TLS, db uintptr) { func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { var zName uintptr _ = zName - switch int32(action) { + switch int32(int32(action)) { case int32(OE_SetNull): zName = __ccgo_ts + 17837 case int32(OE_SetDflt): @@ -113198,7 +113311,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v2 = 0 } size1 = v2 - _returnSingleInt(tls, v, int64(size1)) + _returnSingleInt(tls, v, int64(int64(size1))) } else { /* Malloc may fail when setting the page-size, as there is an internal ** buffer that the pager module resizes using sqlite3_realloc(). @@ -113242,7 +113355,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } } b = _sqlite3BtreeSecureDelete(tls, pBt1, b) - _returnSingleInt(tls, v, int64(b)) + _returnSingleInt(tls, v, int64(int64(b))) break /* ** PRAGMA [schema.]max_page_count @@ -113315,7 +113428,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ; ii1++ } - (*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode = uint8(eMode) + (*Tsqlite3)(unsafe.Pointer(db)).FdfltLockMode = uint8(uint8(eMode)) } pPager = _sqlite3BtreePager(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) @@ -113418,7 +113531,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(_sqlite3BtreeGetAutoVacuum(tls, pBt2))) } else { eAuto = _getAutoVacuum(tls, zRight) - (*Tsqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(uint8(eAuto)) + (*Tsqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(uint8(uint8(eAuto))) /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created @@ -113650,7 +113763,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if iLevel == 0 { iLevel = int32(1) } - (*TDb)(unsafe.Pointer(pDb)).Fsafety_level = uint8(iLevel) + (*TDb)(unsafe.Pointer(pDb)).Fsafety_level = uint8(uint8(iLevel)) (*TDb)(unsafe.Pointer(pDb)).FbSyncSet = uint8(1) _setAllPagerFlags(tls, db) } @@ -113913,12 +114026,12 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } cnum = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2)) - if int32(cnum) < 0 { + if int32(int32(cnum)) < 0 { v22 = uintptr(0) } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18087, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18087, libc.VaList(bp+176, i1, int32(int32(cnum)), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18092, libc.VaList(bp+176, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } @@ -114357,7 +114470,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*uint64(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*uint64(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -114405,7 +114518,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ClearTempRegCache(tls, pParse) /* Do the b-tree integrity checks */ _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(2), cnt, int32(1), aRoot, -int32(14)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(i9))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint8(uint8(i9)))) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18132, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) @@ -114554,9 +114667,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab9)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab9), int16(j4))) + p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab9), int16(int16(j4)))) } else { - p3 = int32(_sqlite3TableColumnToStorage(tls, pTab9, int16(j4))) + p3 = int32(_sqlite3TableColumnToStorage(tls, pTab9, int16(int16(j4)))) } } labelError = _sqlite3VdbeMakeLabel(tls, pParse) @@ -115210,7 +115323,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if szThreshold != 0 { _sqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab11, int32(OP_OpenRead)) - _sqlite3VdbeAddOp3(tls, v, int32(OP_IfSmaller), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1)), int32(szThreshold)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_IfSmaller), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1)), int32(int32(szThreshold))) } zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18559, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab11)).FzName)) if opMask&uint32(0x01) != 0 { @@ -115324,6 +115437,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** instructions to the VM. */ if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_NoColumns1) != 0 && zRight != 0 { } + goto pragma_out pragma_out: ; _sqlite3DbFree(tls, db, zLeft) @@ -115585,7 +115699,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg if !(i < int32((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18592, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18592, libc.VaList(bp+240, int32(int32(cSep)), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -115617,8 +115731,8 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg libc.Xmemset(tls, pTab, 0, uint64(48)) (*TPragmaVtab)(unsafe.Pointer(pTab)).FpName = pPragma (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb = db - (*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden = uint8(i) - (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = uint8(j) + (*TPragmaVtab)(unsafe.Pointer(pTab)).FiHidden = uint8(uint8(i)) + (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = uint8(uint8(j)) } } else { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3799, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) @@ -116057,7 +116171,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr if *(*uintptr)(unsafe.Pointer(argv + 4*8)) != 0 && int32('c') == int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)))))]) && int32('r') == int32(_sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)) + 1)))]) { saved_iDb = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb /* Return code from sqlite3_prepare() */ - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(uint8(iDb)) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { _corruptSchema(tls, pData, argv, __ccgo_ts+14520) @@ -116157,7 +116271,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*(*TInitData)(unsafe.Pointer(bp + 72))).FnInitRow = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = uint32(0) _sqlite3InitCallback(tls, bp+72, int32(5), bp, uintptr(0)) - *(*Tu32)(unsafe.Pointer(db + 44)) &= uint32(mask) + *(*Tu32)(unsafe.Pointer(db + 44)) &= uint32(uint32(mask)) if (*(*TInitData)(unsafe.Pointer(bp + 72))).Frc != 0 { rc = (*(*TInitData)(unsafe.Pointer(bp + 72))).Frc goto error_out @@ -116224,10 +116338,10 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl if iDb == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_EncodingFixed) == uint32(0) { /* If opening the main database, set ENC(db). */ encoding = uint8(int32(uint8((*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)])) & int32(3)) - if int32(encoding) == 0 { + if int32(int32(encoding)) == 0 { encoding = uint8(SQLITE_UTF8) } - if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && int32(encoding) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { + if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && int32(int32(encoding)) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { rc = int32(SQLITE_LOCKED) goto initone_error_out } else { @@ -116314,12 +116428,14 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** curMain and calling sqlite3BtreeEnter(). For an error that occurs ** before that point, jump to error_out. */ + goto initone_error_out initone_error_out: ; if openedTransaction != 0 { _sqlite3BtreeCommit(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) } _sqlite3BtreeLeave(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + goto error_out error_out: ; if rc != 0 { @@ -116708,10 +116824,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } - zSqlCopy = _sqlite3DbStrNDup(tls, db, zSql, uint64(nBytes)) + zSqlCopy = _sqlite3DbStrNDup(tls, db, zSql, uint64(uint64(nBytes))) if zSqlCopy != 0 { _sqlite3RunParser(tls, bp, zSqlCopy) - (*(*TParse)(unsafe.Pointer(bp))).FzTail = zSql + uintptr(int64((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int64(zSqlCopy)) + (*(*TParse)(unsafe.Pointer(bp))).FzTail = zSql + uintptr(int64((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int64(int64(zSqlCopy))) _sqlite3DbFree(tls, db, zSqlCopy) } else { (*(*TParse)(unsafe.Pointer(bp))).FzTail = zSql + uintptr(nBytes) @@ -116723,7 +116839,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep *(*uintptr)(unsafe.Pointer(pzTail)) = (*(*TParse)(unsafe.Pointer(bp))).FzTail } if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { - _sqlite3VdbeSetSql(tls, (*(*TParse)(unsafe.Pointer(bp))).FpVdbe, zSql, int32(int64((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int64(zSql)), uint8(prepFlags)) + _sqlite3VdbeSetSql(tls, (*(*TParse)(unsafe.Pointer(bp))).FpVdbe, zSql, int32(int64((*(*TParse)(unsafe.Pointer(bp))).FzTail)-int64(int64(zSql))), uint8(uint8(prepFlags))) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) @@ -116754,6 +116870,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep (*(*TParse)(unsafe.Pointer(bp))).FpTriggerPrg = (*TTriggerPrg)(unsafe.Pointer(pT)).FpNext _sqlite3DbFree(tls, db, pT) } + goto end_prepare end_prepare: ; _sqlite3ParseObjectReset(tls, bp) @@ -116826,7 +116943,7 @@ func _sqlite3Reprepare(tls *libc.TLS, p uintptr) (r int32) { /* Reprepare only called for prepare_v2() statements */ db = _sqlite3VdbeDb(tls, p) prepFlags = _sqlite3VdbePrepareFlags(tls, p) - rc = _sqlite3LockAndPrepare(tls, db, zSql, -int32(1), uint32(prepFlags), p, bp, uintptr(0)) + rc = _sqlite3LockAndPrepare(tls, db, zSql, -int32(1), uint32(uint32(prepFlags)), p, bp, uintptr(0)) if rc != 0 { if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) @@ -116928,7 +117045,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr ** characters between zSql8 and zTail8, and then returning a pointer ** the same number of characters into the UTF-16 string. */ - chars_parsed = _sqlite3Utf8CharLen(tls, zSql8, int32(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(zSql8))) + chars_parsed = _sqlite3Utf8CharLen(tls, zSql8, int32(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(int64(zSql8)))) *(*uintptr)(unsafe.Pointer(pzTail)) = zSql + uintptr(_sqlite3Utf16ByteLen(tls, zSql, chars_parsed)) } _sqlite3DbFree(tls, db, zSql8) @@ -117108,7 +117225,7 @@ func _clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { // ** Initialize a SelectDest structure. // */ func _sqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { - (*TSelectDest)(unsafe.Pointer(pDest)).FeDest = uint8(eDest) + (*TSelectDest)(unsafe.Pointer(pDest)).FeDest = uint8(uint8(eDest)) (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0 (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst = uintptr(0) @@ -117383,7 +117500,7 @@ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(int32(h)) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { return i } goto _1 @@ -118190,7 +118307,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS } (*(*TRowLoadInfo)(unsafe.Pointer(bp))).FregResult = regResult (*(*TRowLoadInfo)(unsafe.Pointer(bp))).FecelFlags = ecelFlags - if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && int32(ecelFlags)&int32(SQLITE_ECEL_OMITREF) != 0 && nPrefixReg > 0 { + if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && int32(int32(ecelFlags))&int32(SQLITE_ECEL_OMITREF) != 0 && nPrefixReg > 0 { (*TSortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp regOrig = 0 } else { @@ -118405,15 +118522,15 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var p uintptr _, _ = nExtra, p nExtra = int32(uint64(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+uint64(nExtra)) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(40)+uint64(uint64(nExtra)))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 - (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = uint16(N) + (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = uint16(uint16(N)) (*TKeyInfo)(unsafe.Pointer(p)).FnAllField = uint16(N + X) (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, uint64(nExtra)) + libc.Xmemset(tls, p+1*40, 0, uint64(uint64(nExtra))) } else { return _sqlite3OomFault(tls, db) } @@ -119018,7 +119135,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*uint64(uint64(nCol)))) if nCol > int32(32767) { nCol = int32(32767) } @@ -119026,7 +119143,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, nCol = 0 aCol = uintptr(0) } - *(*Ti16)(unsafe.Pointer(pnCol)) = int16(nCol) + *(*Ti16)(unsafe.Pointer(pnCol)) = int16(int16(nCol)) *(*uintptr)(unsafe.Pointer(paCol)) = aCol i = 0 pCol = aCol @@ -119678,6 +119795,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Keep running the loop until the Queue is empty */ _sqlite3VdbeGoto(tls, v, addrTop) _sqlite3VdbeResolveLabel(tls, v, addrBreak) + goto end_of_recursive_query end_of_recursive_query: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSelect)(unsafe.Pointer(p)).FpOrderBy) @@ -119734,7 +119852,7 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if !(bShowAll != 0) { break } - (*TSelect)(unsafe.Pointer(p)).FnSelectRow = int16(nRow) + (*TSelect)(unsafe.Pointer(p)).FnSelectRow = int16(int16(nRow)) p = (*TSelect)(unsafe.Pointer(p)).FpNext } return rc @@ -120074,6 +120192,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in } _sqlite3KeyInfoUnref(tls, pKeyInfo) } + goto multi_select_end multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -120363,7 +120482,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr if pOrderBy != 0 { v4 = nOrderBy nOrderBy++ - *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(v4)*32 + 24)) = uint16(i) + *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(v4)*32 + 24)) = uint16(uint16(i)) } } goto _1 @@ -120379,9 +120498,9 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*uint64(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*uint64(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { - *(*Tu32)(unsafe.Pointer(aPermute)) = uint32(nOrderBy) + *(*Tu32)(unsafe.Pointer(aPermute)) = uint32(uint32(nOrderBy)) i = int32(1) pItem1 = pOrderBy + 8 for { @@ -121033,7 +121152,7 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { if !(pSub1 != 0) { break } - if int32(_sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpEList + 8 + uintptr(ii)*32))).FpExpr)) != int32(aff) { + if int32(_sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub1)).FpEList + 8 + uintptr(ii)*32))).FpExpr)) != int32(int32(aff)) { return int32(1) } goto _2 @@ -121560,7 +121679,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA } *(*TSrcItem)(unsafe.Pointer(pItem)) = *(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104)) p9 = pItem + 60 - *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) | int32(ltorj)) + *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) | int32(int32(ltorj))) iNewParent = (*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104))).FiCursor libc.Xmemset(tls, pSubSrc+8+uintptr(i)*104, 0, uint64(104)) goto _8 @@ -121571,7 +121690,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA p10 = pSrc + 8 + uintptr(iFrom)*104 + 60 *(*Tu8)(unsafe.Pointer(p10)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p10))) & libc.Int32FromInt32(JT_LTORJ)) p11 = pSrc + 8 + uintptr(iFrom)*104 + 60 - *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | (int32(jointype) | int32(ltorj))) + *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | (int32(int32(jointype)) | int32(int32(ltorj)))) /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. ** @@ -121745,7 +121864,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(uint64((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -122125,7 +122244,7 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui break } op = (*TSelect)(unsafe.Pointer(pSel)).Fop - if int32(op) != int32(TK_ALL) && int32(op) != int32(TK_SELECT) { + if int32(int32(op)) != int32(TK_ALL) && int32(int32(op)) != int32(TK_SELECT) { notUnionAll = int32(1) } if (*TSelect)(unsafe.Pointer(pSel)).FpWin != 0 { @@ -122262,12 +122381,12 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) break } iCol = *(*Tu16)(unsafe.Pointer(pList + 8 + uintptr(j)*32 + 24)) - if int32(iCol) > 0 { + if int32(int32(iCol)) > 0 { iCol-- - if int32(iCol) >= int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { + if int32(int32(iCol)) >= int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { v3 = int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1) } else { - v3 = int32(iCol) + v3 = int32(int32(iCol)) } colUsed |= libc.Uint64FromInt32(1) << v3 } @@ -122345,7 +122464,7 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r sortFlags = uint8(0) pEList = *(*uintptr)(unsafe.Pointer(pFunc + 32)) if pEList == uintptr(0) || (*TExprList)(unsafe.Pointer(pEList)).FnExpr != int32(1) || (*TExpr)(unsafe.Pointer(pFunc)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_MinMaxOpt)) != uint32(0) { - return uint8(eRet) + return uint8(uint8(eRet)) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15554) == 0 { @@ -122358,7 +122477,7 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { - return uint8(eRet) + return uint8(uint8(eRet)) } } v1 = _sqlite3ExprListDup(tls, db, pEList, 0) @@ -122367,7 +122486,7 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r if pOrderBy != 0 { (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8))).Ffg.FsortFlags = sortFlags } - return uint8(eRet) + return uint8(uint8(eRet)) } // C documentation @@ -122979,7 +123098,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } - if int32(selFlags)&int32(SF_Expanded) != 0 { + if int32(int32(selFlags))&int32(SF_Expanded) != 0 { return int32(WRC_Prune) } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { @@ -123081,7 +123200,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*TTable)(unsafe.Pointer(pTab)).FnCol = int16(-int32(1)) (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) /* Turn on Select.selId renumbering */ _sqlite3WalkSelect(tls, pWalker, (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect) - (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(eCodeOrig) + (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(uint16(eCodeOrig)) (*TTable)(unsafe.Pointer(pTab)).FnCol = nCol } } @@ -123200,7 +123319,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } zSchemaName = v10 } - if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 1*104 + 60 + 4))&0x400>>10)) != 0 && int32(selFlags)&int32(SF_NestedFrom) != 0 { + if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 1*104 + 60 + 4))&0x400>>10)) != 0 && int32(int32(selFlags))&int32(SF_NestedFrom) != 0 { pUsing = *(*uintptr)(unsafe.Pointer(pFrom + 1*104 + 72)) ii = 0 for { @@ -123226,7 +123345,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pUsing = uintptr(0) } nAdd = int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) - if (*TTable)(unsafe.Pointer(pTab1)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) && int32(selFlags)&int32(SF_NestedFrom) != 0 { + if (*TTable)(unsafe.Pointer(pTab1)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) && int32(int32(selFlags))&int32(SF_NestedFrom) != 0 { nAdd++ } j = 0 @@ -123256,12 +123375,12 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_IncludeHidden) == uint32(0) && int32((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol+uintptr(j)*16)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0 { goto _12 } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 && zTName == uintptr(0) && int32(selFlags)&int32(SF_NestedFrom) == 0 { + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 && zTName == uintptr(0) && int32(int32(selFlags))&int32(SF_NestedFrom) == 0 { goto _12 } } tableSeen = int32(1) - if i > 0 && zTName == uintptr(0) && int32(selFlags)&int32(SF_NestedFrom) == 0 { + if i > 0 && zTName == uintptr(0) && int32(int32(selFlags))&int32(SF_NestedFrom) == 0 { if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 72)), zName) >= 0 { /* In a join with a USING clause, omit columns in the ** using clause from the table on the right. */ @@ -123269,7 +123388,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } pRight = _sqlite3Expr(tls, db, int32(TK_ID), zName) - if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1) && (int32((*TSrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 || int32(selFlags)&int32(SF_NestedFrom) != 0 || !(_inAnyUsingClause(tls, zName, pFrom, (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc-i-int32(1)) != 0)) || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { + if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1) && (int32((*TSrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype)&int32(JT_LTORJ) == 0 || int32(int32(selFlags))&int32(SF_NestedFrom) != 0 || !(_inAnyUsingClause(tls, zName, pFrom, (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc-i-int32(1)) != 0)) || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { pLeft = _sqlite3Expr(tls, db, int32(TK_ID), zTabName) pExpr = _sqlite3PExpr(tls, pParse, int32(TK_DOT), pLeft, pRight) if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TExpr)(unsafe.Pointer(pE)).FpLeft != 0 { @@ -123288,7 +123407,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break /* OOM */ } pX1 = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - if int32(selFlags)&int32(SF_NestedFrom) != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if int32(int32(selFlags))&int32(SF_NestedFrom) != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { @@ -123778,7 +123897,7 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint8(uint8(nArg)))) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab, iTop+int32(1)) _sqlite3VdbeJumpHere(tls, v, iTop) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) @@ -123961,7 +124080,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui } _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint8(uint8(nArg)))) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) } if addrNext != 0 { @@ -125195,7 +125314,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v43 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v42|v43|int32(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v42|v43|int32(int32(distFlag))), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -125378,7 +125497,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _resetAccumulator(tls, pParse, pAggInfo) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iUseFlag) _sqlite3VdbeAddOp1(tls, v, int32(OP_Return), regReset) - if int32(distFlag) != 0 && eDist != WHERE_DISTINCT_NOOP { + if int32(int32(distFlag)) != 0 && eDist != WHERE_DISTINCT_NOOP { pF = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } @@ -125441,7 +125560,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pKeyInfo2 = _sqlite3KeyInfoOfIndex(tls, pParse, pBest) } /* Open a read-only cursor, execute the OP_Count, close the cursor. */ - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, int32(iRoot), iDb, int32(1)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, int32(int32(iRoot)), iDb, int32(1)) if pKeyInfo2 != 0 { _sqlite3VdbeChangeP4(tls, v, -int32(1), pKeyInfo2, -int32(8)) } @@ -125508,7 +125627,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX and pMinMaxOrderBy will ** be an appropriate ORDER BY expression for the optimization. */ - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 64)), pDistinct1, p, uint16(int32(minMaxFlag)|int32(distFlag1)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 64)), pDistinct1, p, uint16(int32(int32(minMaxFlag))|int32(int32(distFlag1))), 0) if pWInfo == uintptr(0) { goto select_end } @@ -125553,6 +125672,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Control jumps to here if an error is encountered above, or upon ** successful coding of the SELECT. */ + goto select_end select_end: ; _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 64))) @@ -125623,9 +125743,9 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { need = nCol } - if (*TTabResult)(unsafe.Pointer(p)).FnData+uint32(need) > (*TTabResult)(unsafe.Pointer(p)).FnAlloc { - (*TTabResult)(unsafe.Pointer(p)).FnAlloc = (*TTabResult)(unsafe.Pointer(p)).FnAlloc*uint32(2) + uint32(need) - azNew = _sqlite3Realloc(tls, (*TTabResult)(unsafe.Pointer(p)).FazResult, uint64(8)*uint64((*TTabResult)(unsafe.Pointer(p)).FnAlloc)) + if (*TTabResult)(unsafe.Pointer(p)).FnData+uint32(uint32(need)) > (*TTabResult)(unsafe.Pointer(p)).FnAlloc { + (*TTabResult)(unsafe.Pointer(p)).FnAlloc = (*TTabResult)(unsafe.Pointer(p)).FnAlloc*uint32(2) + uint32(uint32(need)) + azNew = _sqlite3Realloc(tls, (*TTabResult)(unsafe.Pointer(p)).FazResult, uint64(uint64(8)*uint64((*TTabResult)(unsafe.Pointer(p)).FnAlloc))) if azNew == uintptr(0) { goto malloc_failed } @@ -125635,7 +125755,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr ** the names of all columns. */ if (*TTabResult)(unsafe.Pointer(p)).FnRow == uint32(0) { - (*TTabResult)(unsafe.Pointer(p)).FnColumn = uint32(nCol) + (*TTabResult)(unsafe.Pointer(p)).FnColumn = uint32(uint32(nCol)) i = 0 for { if !(i < nCol) { @@ -125674,11 +125794,11 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr z = uintptr(0) } else { n = _sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + int32(1) - z = Xsqlite3_malloc64(tls, uint64(n)) + z = Xsqlite3_malloc64(tls, uint64(uint64(n))) if z == uintptr(0) { goto malloc_failed } - libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(n)) + libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(uint64(n))) } v6 = p + 28 v5 = *(*Tu32)(unsafe.Pointer(v6)) @@ -125692,6 +125812,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr (*TTabResult)(unsafe.Pointer(p)).FnRow++ } return 0 + goto malloc_failed malloc_failed: ; (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -125733,7 +125854,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp (*(*TTabResult)(unsafe.Pointer(bp))).FnData = uint32(1) (*(*TTabResult)(unsafe.Pointer(bp))).FnAlloc = uint32(20) (*(*TTabResult)(unsafe.Pointer(bp))).Frc = SQLITE_OK - (*(*TTabResult)(unsafe.Pointer(bp))).FazResult = Xsqlite3_malloc64(tls, uint64(8)*uint64((*(*TTabResult)(unsafe.Pointer(bp))).FnAlloc)) + (*(*TTabResult)(unsafe.Pointer(bp))).FazResult = Xsqlite3_malloc64(tls, uint64(uint64(8)*uint64((*(*TTabResult)(unsafe.Pointer(bp))).FnAlloc))) if (*(*TTabResult)(unsafe.Pointer(bp))).FazResult == uintptr(0) { (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = int32(SQLITE_NOMEM) return int32(SQLITE_NOMEM) @@ -125759,7 +125880,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp return rc } if (*(*TTabResult)(unsafe.Pointer(bp))).FnAlloc > (*(*TTabResult)(unsafe.Pointer(bp))).FnData { - azNew = _sqlite3Realloc(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FazResult, uint64(8)*uint64((*(*TTabResult)(unsafe.Pointer(bp))).FnData)) + azNew = _sqlite3Realloc(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FazResult, uint64(uint64(8)*uint64((*(*TTabResult)(unsafe.Pointer(bp))).FnData))) if azNew == uintptr(0) { Xsqlite3_free_table(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FazResult+1*8) (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = int32(SQLITE_NOMEM) @@ -126048,7 +126169,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 (*TTrigger)(unsafe.Pointer(pTrigger)).Ftable = _sqlite3DbStrDup(tls, db, (*(*TSrcItem)(unsafe.Pointer(pTableName + 8))).FzName) (*TTrigger)(unsafe.Pointer(pTrigger)).FpSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema - (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = uint8(op) + (*TTrigger)(unsafe.Pointer(pTrigger)).Fop = uint8(uint8(op)) if tr_tm == int32(TK_BEFORE) { v4 = int32(TRIGGER_BEFORE) } else { @@ -126065,6 +126186,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 (*TTrigger)(unsafe.Pointer(pTrigger)).FpColumns = pColumns pColumns = uintptr(0) (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger = pTrigger + goto trigger_cleanup trigger_cleanup: ; _sqlite3DbFree(tls, db, zName) @@ -126076,6 +126198,7 @@ trigger_cleanup: } else { } return + goto trigger_orphan_error trigger_orphan_error: ; if int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) == int32(1) { @@ -126180,6 +126303,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } } } + goto triggerfinish_cleanup triggerfinish_cleanup: ; _sqlite3DeleteTrigger(tls, db, pTrig) @@ -126254,7 +126378,7 @@ func _triggerStepAllocate(tls *libc.TLS, pParse uintptr, op Tu8, pName uintptr, if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return uintptr(0) } - pTriggerStep = _sqlite3DbMallocZero(tls, db, uint64(96)+uint64((*TToken)(unsafe.Pointer(pName)).Fn)+uint64(1)) + pTriggerStep = _sqlite3DbMallocZero(tls, db, uint64(uint64(96)+uint64((*TToken)(unsafe.Pointer(pName)).Fn)+uint64(1))) if pTriggerStep != 0 { z = pTriggerStep + 1*96 libc.Xmemcpy(tls, z, (*TToken)(unsafe.Pointer(pName)).Fz, uint64((*TToken)(unsafe.Pointer(pName)).Fn)) @@ -126438,6 +126562,7 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) + goto drop_trigger_cleanup drop_trigger_cleanup: ; _sqlite3SrcListDelete(tls, db, pName) @@ -126617,7 +126742,7 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if int32((*TTrigger)(unsafe.Pointer(p)).Fop) == int32(TK_RETURNING) { /* The first time a RETURNING trigger is seen, the "op" value tells ** us what time of trigger it should be. */ - (*TTrigger)(unsafe.Pointer(p)).Fop = uint8(op) + (*TTrigger)(unsafe.Pointer(p)).Fop = uint8(uint8(op)) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { @@ -126642,6 +126767,7 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p = (*TTrigger)(unsafe.Pointer(p)).FpNext } } + goto exit_triggers_exist exit_triggers_exist: ; if pMask != 0 { @@ -126912,7 +127038,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon if orconf == int32(OE_Default) { v2 = int32((*TTriggerStep)(unsafe.Pointer(pStep)).Forconf) } else { - v2 = int32(uint8(orconf)) + v2 = int32(uint8(uint8(orconf))) } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = uint8(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { @@ -127121,7 +127247,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** invocation is disallowed if (a) the sub-program is really a trigger, ** not a foreign key action, and (b) the flag to enable recursive triggers ** is clear. */ - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(bRecursive))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint8(uint8(bRecursive)))) } } @@ -127335,7 +127461,7 @@ func _indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef u _ = iIdxCol iIdxCol = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)) /* Cannot index rowid */ - if int32(iIdxCol) >= 0 { + if int32(int32(iIdxCol)) >= 0 { return libc.BoolInt32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0) } return _sqlite3ExprReferencesUpdatedColumn(tls, (*(*TExprList_item)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaColExpr + 8 + uintptr(iCol)*32))).FpExpr, aXRef, chngRowid) @@ -127642,7 +127768,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*uint64(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+uint64(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*uint64(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+uint64(uint64(nIdx))+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -127697,7 +127823,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == int32(int32(hCol)) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr @@ -127750,7 +127876,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ; i++ } - chngKey = uint8(int32(chngRowid) + int32(chngPk)) + chngKey = uint8(int32(int32(chngRowid)) + int32(int32(chngPk))) /* Mark generated columns as changing if their generator expressions ** reference any changing column. The actual aXRef[] value for ** generated expressions is not used, other than to check to see that it @@ -127772,7 +127898,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { goto _12 } - if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, int32(chngRowid)) != 0 { + if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, int32(int32(chngRowid))) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } @@ -127794,7 +127920,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui v13 = uint64(0) } (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 - hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, int32(chngKey)) + hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, int32(int32(chngKey))) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold ** the key for accessing each index. @@ -127808,7 +127934,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(pIdx != 0) { break } - if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0 { + if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, int32(int32(chngRowid))) != 0 { v16 = pParse + 56 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) @@ -127821,7 +127947,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0 { + if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(int32(chngRowid))) != 0 { v19 = pParse + 56 *(*int32)(unsafe.Pointer(v19))++ v18 = *(*int32)(unsafe.Pointer(v19)) @@ -127939,7 +128065,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } nPk = int16(v32) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk) + *(*int32)(unsafe.Pointer(pParse + 56)) += int32(int32(nPk)) *(*int32)(unsafe.Pointer(pParse + 56)) += nChangeFrom v34 = pParse + 56 *(*int32)(unsafe.Pointer(v34))++ @@ -127951,19 +128077,19 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } else { v35 = 0 } - nEphCol = int32(nPk) + nChangeFrom + v35 + nEphCol = int32(int32(nPk)) + nChangeFrom + v35 v37 = pParse + 52 v36 = *(*int32)(unsafe.Pointer(v37)) *(*int32)(unsafe.Pointer(v37))++ iEph = v36 if pPk != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iPk, iPk+int32(nPk)-int32(1)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iPk, iPk+int32(int32(nPk))-int32(1)) } addrOpen = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), iEph, nEphCol) if pPk != 0 { pKeyInfo = _sqlite3KeyInfoOfIndex(tls, pParse, pPk) if pKeyInfo != 0 { - (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = uint16(nEphCol) + (*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = uint16(uint16(nEphCol)) _sqlite3VdbeAppendP4(tls, v, pKeyInfo, -int32(8)) } } @@ -127978,7 +128104,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if nChangeFrom != 0 { _sqlite3MultiWrite(tls, pParse) eOnePass = ONEPASS_OFF - nKey = int32(nPk) + nKey = int32(int32(nPk)) regKey = iPk } else { if pUpsert != 0 { @@ -128007,7 +128133,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !(pTrigger != 0) && !(hasFK != 0) && !(chngKey != 0) && !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) && (pWhere == uintptr(0) || !((*TExpr)(unsafe.Pointer(pWhere)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != libc.Uint32FromInt32(0))) { flags |= int32(WHERE_ONEPASS_MULTIROW) } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(flags), iIdxCur) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uintptr(0), uint16(uint16(flags)), iIdxCur) if pWInfo == uintptr(0) { goto update_cleanup } @@ -128057,7 +128183,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is not required) and leave the PK fields in the array of registers. */ i = 0 for { - if !(i < int32(nPk)) { + if !(i < int32(int32(nPk))) { break } _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), iPk+i) @@ -128070,11 +128196,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if addrOpen != 0 { _sqlite3VdbeChangeToNoop(tls, v, addrOpen) } - nKey = int32(nPk) + nKey = int32(int32(nPk)) regKey = iPk } else { - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), iPk, int32(nPk), regKey, _sqlite3IndexAffinityStr(tls, db, pPk), int32(nPk)) - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iEph, regKey, iPk, int32(nPk)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), iPk, int32(int32(nPk)), regKey, _sqlite3IndexAffinityStr(tls, db, pPk), int32(int32(nPk))) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iEph, regKey, iPk, int32(int32(nPk))) } } } @@ -128127,7 +128253,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if pPk != 0 { i = 0 for { - if !(i < int32(nPk)) { + if !(i < int32(int32(nPk))) { break } _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, i, iPk+i) @@ -128136,7 +128262,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ; i++ } - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), iDataCur, labelContinue, iPk, int32(nPk)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), iDataCur, labelContinue, iPk, int32(int32(nPk))) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iEph, regOldRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_NotExists), iDataCur, labelContinue, regOldRowid) @@ -128182,7 +128308,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } colFlags = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - k = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld + k = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(i)))) + regOld if oldmask == uint32(0xffffffff) || i < int32(32) && oldmask&(libc.Uint32FromInt32(1)< int32(31) || uint32(newmask)&(libc.Uint32FromInt32(1)< int32(31) || uint32(uint32(newmask))&(libc.Uint32FromInt32(1)<= 0 { pRow = _sqlite3ExprDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*32))).FpExpr, 0) } else { - pRow = _exprRowColumn(tls, pParse, int32(iPk)) + pRow = _exprRowColumn(tls, pParse, int32(int32(iPk))) } } pList = _sqlite3ExprListAppend(tls, pParse, uintptr(0), pRow) @@ -128559,8 +128686,8 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp } else { /* PRIMARY KEY column */ pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) iPk1 = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk1)).FaiColumn)) - _sqlite3VdbeAddOp3(tls, v, int32(OP_VColumn), iCsr, int32(iPk1), regArg) - _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), regArg+int32(2)+int32(iPk1), regArg+int32(1)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_VColumn), iCsr, int32(int32(iPk1)), regArg) + _sqlite3VdbeAddOp2(tls, v, int32(OP_SCopy), regArg+int32(2)+int32(int32(iPk1)), regArg+int32(1)) } eOnePass = _sqlite3WhereOkOnePass(tls, pWInfo, bp) /* There is no ONEPASS_MULTI on virtual tables */ @@ -129135,6 +129262,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) _sqlite3VdbeAddOp2(tls, v, int32(OP_Vacuum), iDb, iIntoReg) _sqlite3VdbeUsesBtree(tls, v, iDb) } + goto build_vacuum_end build_vacuum_end: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pInto) @@ -129270,7 +129398,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(nDb) /* force new CREATE statements into vacuum_db */ + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(uint8(nDb)) /* force new CREATE statements into vacuum_db */ rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21288, libc.VaList(bp+24, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum @@ -129333,6 +129461,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p nRes = _sqlite3BtreeGetRequestedReserve(tls, pTemp) rc = _sqlite3BtreeSetPageSize(tls, pMain, _sqlite3BtreeGetPageSize(tls, pTemp), nRes, int32(1)) } + goto end_of_vacuum end_of_vacuum: ; /* Restore the original value of db->flags */ @@ -129436,7 +129565,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+uint64(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+uint64(uint64(nName))+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -129826,7 +129955,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FnArg int32 FazArg uintptr Fp uintptr - })(unsafe.Pointer(pTable + 64))).FazArg, uint64(nBytes)) + })(unsafe.Pointer(pTable + 64))).FazArg, uint64(uint64(nBytes))) if azModuleArg == uintptr(0) { _sqlite3DbFree(tls, db, zArg) } else { @@ -129901,7 +130030,7 @@ func _addArgumentToVtab(tls *libc.TLS, pParse uintptr) { z = (*TParse)(unsafe.Pointer(pParse)).FsArg.Fz n = int32((*TParse)(unsafe.Pointer(pParse)).FsArg.Fn) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - _addModuleArgument(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpNewTable, _sqlite3DbStrNDup(tls, db, z, uint64(n))) + _addModuleArgument(tls, pParse, (*TParse)(unsafe.Pointer(pParse)).FpNewTable, _sqlite3DbStrNDup(tls, db, z, uint64(uint64(n)))) } } @@ -130169,7 +130298,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasHidden) oooHidden = uint16(TF_OOOHidden) } else { - *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(oooHidden) + *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(uint32(oooHidden)) } goto _2 _2: @@ -130244,12 +130373,12 @@ func _growVTrans(tls *libc.TLS, db uintptr) (r int32) { ARRAY_INCR = int32(5) /* Grow the sqlite3.aVTrans array if required */ if (*Tsqlite3)(unsafe.Pointer(db)).FnVTrans%ARRAY_INCR == 0 { - nBytes = int64(uint64(8) * uint64(int64((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)+int64(ARRAY_INCR))) - aVTrans = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans, uint64(nBytes)) + nBytes = int64(uint64(8) * uint64(int64((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)+int64(int64(ARRAY_INCR)))) + aVTrans = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans, uint64(uint64(nBytes))) if !(aVTrans != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, aVTrans+uintptr((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)*8, 0, uint64(8)*uint64(ARRAY_INCR)) + libc.Xmemset(tls, aVTrans+uintptr((*Tsqlite3)(unsafe.Pointer(db)).FnVTrans)*8, 0, uint64(8)*uint64(uint64(ARRAY_INCR))) (*Tsqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans } return SQLITE_OK @@ -130396,7 +130525,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i } _sqlite3DeleteTable(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable) _sqlite3ParseObjectReset(tls, bp) - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(initBusy) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(uint8(initBusy)) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130743,7 +130872,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+uint64(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+uint64(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -130788,7 +130917,7 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { i++ } n = int32(uint64((*TParse)(unsafe.Pointer(pToplevel)).FnVtabLock+libc.Int32FromInt32(1)) * uint64(8)) - apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n)) + apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(uint64(n))) if apVtabLock != 0 { (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock v4 = pToplevel + 312 @@ -131745,20 +131874,20 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { pIndex = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq nSkip = (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip - if int32(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { + if int32(int32(nEq)) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } Xsqlite3_str_append(tls, pStr, __ccgo_ts+22025, int32(2)) i = 0 for { - if !(i < int32(nEq)) { + if !(i < int32(int32(nEq))) { break } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { Xsqlite3_str_append(tls, pStr, __ccgo_ts+22017, int32(5)) } - if i >= int32(nSkip) { + if i >= int32(int32(nSkip)) { v2 = __ccgo_ts + 22028 } else { v2 = __ccgo_ts + 22033 @@ -131813,10 +131942,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if flags&uint32(WHERE_MULTI_OR) != 0 || int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if flags&uint32(WHERE_MULTI_OR) != 0 || int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) != 0 { return 0 } - isSearch = libc.BoolInt32(flags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) > 0 || int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) + isSearch = libc.BoolInt32(flags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && int32((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) > 0 || int32(int32(wctrlFlags))&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { @@ -131870,7 +131999,7 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22197, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22197, libc.VaList(bp+144, int32(int32(cRangeOp)))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22202, libc.VaList(bp+144, (*(*struct { @@ -132293,7 +132422,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint db = (*TParse)(unsafe.Pointer(pParse)).Fdb pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*uint64(nEq)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*uint64(uint64(nEq)))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) } @@ -132305,7 +132434,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint } else { v3 = n } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*uint64(v3)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*uint64(v3))) eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } pX = pExpr @@ -132343,10 +132472,10 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*uint64((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*uint64((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -132487,12 +132616,12 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i /* Figure out how many memory cells we will need then allocate them. */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - nReg = int32(nEq) + nExtraReg + nReg = int32(int32(nEq)) + nExtraReg *(*int32)(unsafe.Pointer(pParse + 56)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, regBase, regBase+int32(nSkip)-int32(1)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, regBase, regBase+int32(int32(nSkip))-int32(1)) if bRev != 0 { v1 = int32(OP_Last) } else { @@ -132505,11 +132634,11 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i } else { v2 = int32(OP_SeekGT) } - (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = _sqlite3VdbeAddOp4Int(tls, v, v2, iIdxCur, 0, regBase, int32(nSkip)) + (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = _sqlite3VdbeAddOp4Int(tls, v, v2, iIdxCur, 0, regBase, int32(int32(nSkip))) _sqlite3VdbeJumpHere(tls, v, j) j = 0 for { - if !(j < int32(nSkip)) { + if !(j < int32(int32(nSkip))) { break } _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, j, regBase+j) @@ -132521,9 +132650,9 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i } /* Evaluate the equality constraints */ - j = int32(nSkip) + j = int32(int32(nSkip)) for { - if !(j < int32(nEq)) { + if !(j < int32(int32(nEq))) { break } pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)) @@ -132619,7 +132748,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*uint64(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*uint64(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = uint32((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -132628,7 +132757,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, break } x1 = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) - x2 = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(x1))) + x2 = int32(_sqlite3TableColumnToStorage(tls, pTab, int16(int16(x1)))) if x1 >= 0 { *(*Tu32)(unsafe.Pointer(ai + uintptr(x2+int32(1))*4)) = uint32(i + int32(1)) } @@ -132774,9 +132903,9 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 } else { nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq r1 = _codeAllEqualityTerms(tls, pParse, pLevel, 0, 0, bp) - _codeApplyAffinity(tls, pParse, r1, int32(nEq), *(*uintptr)(unsafe.Pointer(bp))) + _codeApplyAffinity(tls, pParse, r1, int32(int32(nEq)), *(*uintptr)(unsafe.Pointer(bp))) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(bp))) - _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, r1, int32(nEq)) + _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, r1, int32(int32(nEq))) } (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter = 0 (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk = 0 @@ -133210,7 +133339,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI /* Find any inequality constraint terms for the start and end ** of the range. */ - j = int32(nEq) + j = int32(int32(nEq)) if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BTM_LIMIT) != 0 { v34 = j j++ @@ -133265,16 +133394,16 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** a forward order scan on a descending index, interchange the ** start and end terms (pRangeStart and pRangeEnd). */ - if int32(nEq) < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.BoolInt32(int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC) { + if int32(int32(nEq)) < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) && bRev == libc.BoolInt32(int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == SQLITE_SO_ASC) { t = pRangeEnd pRangeEnd = pRangeStart pRangeStart = t t1 = bSeekPastNull bSeekPastNull = bStopAtNull bStopAtNull = t1 - t2 = uint8(nBtm) + t2 = uint8(uint8(nBtm)) nBtm = nTop - nTop = uint16(t2) + nTop = uint16(uint16(t2)) } if iLevel > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) != uint32(0) { /* In case OP_SeekScan is used, ensure that the index cursor does not @@ -133297,19 +133426,19 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrNxt = v41 startEq = libc.BoolInt32(!(pRangeStart != 0) || int32((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) endEq = libc.BoolInt32(!(pRangeEnd != 0) || int32((*TWhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0) - start_constraints = libc.BoolInt32(pRangeStart != 0 || int32(nEq) > 0) + start_constraints = libc.BoolInt32(pRangeStart != 0 || int32(int32(nEq)) > 0) /* Seek the index cursor to the start of the range. */ - nConstraint1 = int32(nEq) + nConstraint1 = int32(int32(nEq)) if pRangeStart != 0 { pRight2 = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FpExpr)).FpRight - _codeExprOrVector(tls, pParse, pRight2, regBase+int32(nEq), int32(nBtm)) + _codeExprOrVector(tls, pParse, pRight2, regBase+int32(int32(nEq)), int32(int32(nBtm))) if int32((*TWhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags)&int32(TERM_VNULL) == 0 && _sqlite3ExprCanBeNull(tls, pRight2) != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+int32(nEq), addrNxt) + _sqlite3VdbeAddOp2(tls, v, int32(OP_IsNull), regBase+int32(int32(nEq)), addrNxt) } if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { - _updateRangeAffinityStr(tls, pRight2, int32(nBtm), *(*uintptr)(unsafe.Pointer(bp + 8))+uintptr(nEq)) + _updateRangeAffinityStr(tls, pRight2, int32(int32(nBtm)), *(*uintptr)(unsafe.Pointer(bp + 8))+uintptr(nEq)) } - nConstraint1 += int32(nBtm) + nConstraint1 += int32(int32(nBtm)) if _sqlite3ExprIsVector(tls, pRight2) == 0 { _disableTerm(tls, pLevel, pRangeStart) } else { @@ -133319,18 +133448,18 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if bSeekPastNull != 0 { startEq = 0 - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(nEq)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(int32(nEq))) start_constraints = int32(1) nConstraint1++ } else { if regBignull != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(nEq)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regBase+int32(int32(nEq))) start_constraints = int32(1) nConstraint1++ } } } - _codeApplyAffinity(tls, pParse, regBase, nConstraint1-int32(bSeekPastNull), *(*uintptr)(unsafe.Pointer(bp + 8))) + _codeApplyAffinity(tls, pParse, regBase, nConstraint1-int32(int32(bSeekPastNull)), *(*uintptr)(unsafe.Pointer(bp + 8))) if int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0 && nConstraint1 == int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { /* The skip-scan logic inside the call to codeAllEqualityConstraints() ** above has already left the cursor sitting on the correct row, @@ -133340,7 +133469,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), regBignull) } if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regBase, int32(nEq)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regBase, int32(int32(nEq))) _filterPullDown(tls, pParse, pWInfo, iLevel, addrNxt, notReady) } op1 = int32(_aStartOp[start_constraints< int32(1) { /* Original list of tables */ nNotReady = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(112)+uint64(nNotReady)*uint64(104)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(112)+uint64(uint64(nNotReady))*uint64(104))) if pOrTab == uintptr(0) { return notReady } @@ -134026,6 +134155,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -134273,9 +134403,9 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*uint64((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*uint64((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { - if int32(wtFlags)&int32(TERM_DYNAMIC) != 0 { + if int32(int32(wtFlags))&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) } (*TWhereClause)(unsafe.Pointer(pWC)).Fa = pOld @@ -134290,7 +134420,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r v1 = v2 idx = v1 pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(v1)*56 - if int32(wtFlags)&int32(TERM_VIRTUAL) == 0 { + if int32(int32(wtFlags))&int32(TERM_VIRTUAL) == 0 { (*TWhereClause)(unsafe.Pointer(pWC)).FnBase = (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm } if p != 0 && (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_Unlikely)) != uint32(0) { @@ -134414,11 +134544,11 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt for { v1 = *(*Tu8)(unsafe.Pointer(z + uintptr(cnt))) c = v1 - if !(int32(v1) != 0 && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(1)]) && int32(c) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(2)])) { + if !(int32(v1) != 0 && int32(int32(c)) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(int32(c)) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(1)]) && int32(int32(c)) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(2)])) { break } cnt++ - if int32(c) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 { + if int32(int32(c)) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 { cnt++ } } @@ -134432,7 +134562,7 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt ** removed. */ if (cnt > int32(1) || cnt > 0 && int32(*(*Tu8)(unsafe.Pointer(z))) != int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)])) && int32(255) != int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt-int32(1))))) { /* A "complete" match if the pattern ends with "*" or "%" */ - *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(int32(c) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0) + *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(int32(int32(c)) == int32((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0) /* Get the pattern prefix. Remove all escapes from the prefix. */ pPrefix = _sqlite3Expr(tls, db, int32(TK_STRING), z) if pPrefix != 0 { @@ -134600,7 +134730,7 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui if (*Tsqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction != uintptr(0) { i = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction})))(tls, pVtab, int32(2), *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp, bp+8) if i >= int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) { - *(*uint8)(unsafe.Pointer(peOp2)) = uint8(i) + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(uint8(i)) *(*uintptr)(unsafe.Pointer(ppRight)) = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr *(*uintptr)(unsafe.Pointer(ppLeft)) = pCol return int32(1) @@ -134745,7 +134875,7 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp if int32((*TWhereTerm)(unsafe.Pointer(pTwo)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) == 0 { return } - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != int32(eOp) && int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != int32(eOp) { + if int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != int32(int32(eOp)) && int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != int32(int32(eOp)) { return } if _sqlite3ExprCompare(tls, uintptr(0), (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pOne)).FpExpr)).FpLeft, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTwo)).FpExpr)).FpLeft, -int32(1)) != 0 { @@ -134755,8 +134885,8 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp return } /* If we reach this point, it means the two subterms can be combined */ - if int32(eOp)&(int32(eOp)-int32(1)) != 0 { - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != 0 { + if int32(int32(eOp))&(int32(int32(eOp))-int32(1)) != 0 { + if int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) != 0 { eOp = uint16(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) } else { eOp = uint16(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) @@ -134769,7 +134899,7 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp } op = int32(TK_EQ) for { - if !(int32(eOp) != int32(WO_EQ)<<(op-int32(TK_EQ))) { + if !(int32(int32(eOp)) != int32(WO_EQ)<<(op-int32(TK_EQ))) { break } goto _1 @@ -134777,7 +134907,7 @@ func _whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintp ; op++ } - (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(uint8(op)) idxNew = _whereClauseInsert(tls, pWC, pNew, uint16(libc.Int32FromInt32(TERM_VIRTUAL)|libc.Int32FromInt32(TERM_DYNAMIC))) _exprAnalyze(tls, pSrc, pWC, idxNew) } @@ -135198,7 +135328,7 @@ func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) - if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { + if int32(int32(aff1)) != int32(int32(aff2)) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { return 0 } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) @@ -135489,7 +135619,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { FleftColumn int32 FiField int32 })(unsafe.Pointer(pTerm + 32))).FleftColumn = (*(*[2]int32)(unsafe.Pointer(bp + 24)))[int32(1)] - (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(int32(_operatorMask(tls, op)) & int32(opMask)) + (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(int32(_operatorMask(tls, op)) & int32(int32(opMask))) } if op == int32(TK_IS) { p3 = pTerm + 18 @@ -135534,7 +135664,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { })(unsafe.Pointer(pNew + 32))).FleftColumn = (*(*[2]int32)(unsafe.Pointer(bp + 24)))[int32(1)] (*TWhereTerm)(unsafe.Pointer(pNew)).FprereqRight = prereqLeft | extraRight (*TWhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll - (*TWhereTerm)(unsafe.Pointer(pNew)).FeOperator = uint16((int32(_operatorMask(tls, int32((*TExpr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask)) + (*TWhereTerm)(unsafe.Pointer(pNew)).FeOperator = uint16((int32(_operatorMask(tls, int32((*TExpr)(unsafe.Pointer(pDup)).Fop))) + int32(int32(eExtraOp))) & int32(int32(opMask))) } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ @@ -135626,12 +135756,12 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ - if int32(c1) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { + if int32(int32(c1)) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { *(*int32)(unsafe.Pointer(bp + 8)) = 0 } c1 = _sqlite3UpperToLower[c1] } - *(*Tu8)(unsafe.Pointer(pC)) = uint8(int32(c1) + int32(1)) + *(*Tu8)(unsafe.Pointer(pC)) = uint8(int32(int32(c1)) + int32(1)) } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { v13 = __ccgo_ts + 22355 @@ -135799,7 +135929,7 @@ func _sqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op Tu8) { if pE2 == uintptr(0) { return } - if int32((*TExpr)(unsafe.Pointer(pE2)).Fop) != int32(op) { + if int32((*TExpr)(unsafe.Pointer(pE2)).Fop) != int32(int32(op)) { _whereClauseInsert(tls, pWC, pExpr, uint16(0)) } else { _sqlite3WhereSplit(tls, pWC, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, op) @@ -135851,7 +135981,7 @@ func _whereAddLimitExpr(tls *libc.TLS, pWC uintptr, iReg int32, pExpr uintptr, i pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idx)*56 (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = iCsr (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(WO_AUX) - (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp = uint8(eMatchOp) + (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp = uint8(uint8(eMatchOp)) } } @@ -136452,13 +136582,13 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, i = (*TWhereOrSet)(unsafe.Pointer(pSet)).Fn p = pSet + 8 for { - if !(int32(i) > 0) { + if !(int32(int32(i)) > 0) { break } - if int32(rRun) <= int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) && prereq&(*TWhereOrCost)(unsafe.Pointer(p)).Fprereq == prereq { + if int32(int32(rRun)) <= int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) && prereq&(*TWhereOrCost)(unsafe.Pointer(p)).Fprereq == prereq { goto whereOrInsert_done } - if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun) && (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq&prereq == (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq { + if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(int32(rRun)) && (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq&prereq == (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq { return 0 } goto _1 @@ -136477,7 +136607,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, p = pSet + 8 i = uint16(1) for { - if !(int32(i) < int32((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn)) { + if !(int32(int32(i)) < int32((*TWhereOrSet)(unsafe.Pointer(pSet)).Fn)) { break } if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) > int32((*(*TWhereOrCost)(unsafe.Pointer(pSet + 8 + uintptr(i)*16))).FrRun) { @@ -136488,15 +136618,16 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, ; i++ } - if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(rRun) { + if int32((*TWhereOrCost)(unsafe.Pointer(p)).FrRun) <= int32(int32(rRun)) { return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq (*TWhereOrCost)(unsafe.Pointer(p)).FrRun = rRun - if int32((*TWhereOrCost)(unsafe.Pointer(p)).FnOut) > int32(nOut) { + if int32((*TWhereOrCost)(unsafe.Pointer(p)).FnOut) > int32(int32(nOut)) { (*TWhereOrCost)(unsafe.Pointer(p)).FnOut = nOut } return int32(1) @@ -136554,7 +136685,7 @@ func _sqlite3WhereRealloc(tls *libc.TLS, pWInfo uintptr, pOld uintptr, nByte Tu6 if pNew != 0 && pOld != 0 { pOldBlk = pOld pOldBlk -= 16 - libc.Xmemcpy(tls, pNew, pOld, (*TWhereMemBlock)(unsafe.Pointer(pOldBlk)).Fsz) + libc.Xmemcpy(tls, pNew, pOld, uint64((*TWhereMemBlock)(unsafe.Pointer(pOldBlk)).Fsz)) } return pNew } @@ -136620,7 +136751,7 @@ func _whereScanNext(tls *libc.TLS, pScan uintptr) (r uintptr) { if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur && (*(*struct { FleftColumn int32 FiField int32 - })(unsafe.Pointer(pTerm + 32))).FleftColumn == int32(iColumn) && (int32(iColumn) != -int32(2) || _sqlite3ExprCompareSkip(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*TWhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) && (int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= int32(1) || !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0))) { + })(unsafe.Pointer(pTerm + 32))).FleftColumn == int32(int32(iColumn)) && (int32(int32(iColumn)) != -int32(2) || _sqlite3ExprCompareSkip(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*TWhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0) && (int32((*TWhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= int32(1) || !((*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0))) { if v3 = int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) != 0 && int32((*TWhereScan)(unsafe.Pointer(pScan)).FnEquiv) < int32(libc.Uint64FromInt64(44)/libc.Uint64FromInt64(4)); v3 { v2 = _whereRightSubexprIsColumn(tls, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr) pX = v2 @@ -136761,7 +136892,7 @@ func _whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColu return uintptr(0) } } - *(*Ti16)(unsafe.Pointer(pScan + 88)) = int16(iColumn) + *(*Ti16)(unsafe.Pointer(pScan + 88)) = int16(int16(iColumn)) return _whereScanNext(tls, pScan) } @@ -136977,10 +137108,10 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u func _estLog(tls *libc.TLS, N TLogEst) (r TLogEst) { var v1 int32 _ = v1 - if int32(N) <= int32(10) { + if int32(int32(N)) <= int32(10) { v1 = 0 } else { - v1 = int32(_sqlite3LogEst(tls, uint64(N))) - int32(33) + v1 = int32(_sqlite3LogEst(tls, uint64(uint64(N)))) - int32(33) } return int16(v1) } @@ -137185,7 +137316,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ; pTerm += 56 } - v4 = uint16(nKeyCol) + v4 = uint16(uint16(nKeyCol)) (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = v4 (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = v4 (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED) | libc.Int32FromInt32(WHERE_AUTO_INDEX)) @@ -137289,7 +137420,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea break } if extraCols&(libc.Uint64FromInt32(1)<nField value before returning. */ - (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = uint16(nField) + (*TUnpackedRecord)(unsafe.Pointer(pRec)).FnField = uint16(uint16(nField)) return i } @@ -138112,7 +138244,7 @@ func _whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUppe ** the number of rows visited. Otherwise, estimate the number of rows ** using the method described in the header comment for this function. */ if nDiff != int32(1) || pUpper == uintptr(0) || pLower == uintptr(0) { - nAdjust = int32(_sqlite3LogEst(tls, uint64((*TIndex)(unsafe.Pointer(p)).FnSample))) - int32(_sqlite3LogEst(tls, uint64(nDiff))) + nAdjust = int32(_sqlite3LogEst(tls, uint64((*TIndex)(unsafe.Pointer(p)).FnSample))) - int32(_sqlite3LogEst(tls, uint64(uint64(nDiff)))) p3 = pLoop + 22 *(*TLogEst)(unsafe.Pointer(p3)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p3))) - nAdjust) *(*int32)(unsafe.Pointer(pbDone)) = int32(1) @@ -138226,7 +138358,7 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower mask = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) } iLwrIdx = _whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp)), 0, bp+8) - if int32((*TWhereTerm)(unsafe.Pointer(pLower)).FeOperator)&int32(mask) != 0 { + if int32((*TWhereTerm)(unsafe.Pointer(pLower)).FeOperator)&int32(int32(mask)) != 0 { v1 = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 8)))[int32(1)] } else { v1 = uint64(0) @@ -138249,7 +138381,7 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower mask1 = uint16(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))) } iUprIdx = _whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp)), int32(1), bp+8) - if int32((*TWhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&int32(mask1) != 0 { + if int32((*TWhereTerm)(unsafe.Pointer(pUpper)).FeOperator)&int32(int32(mask1)) != 0 { v2 = (*(*[2]TtRowcnt)(unsafe.Pointer(bp + 8)))[int32(1)] } else { v2 = uint64(0) @@ -138276,8 +138408,8 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower } else { nNew = int16(10) } - if int32(nNew) < nOut { - nOut = int32(nNew) + if int32(int32(nNew)) < nOut { + nOut = int32(int32(nNew)) } } } else { @@ -138288,7 +138420,7 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower } } } - nNew = _whereRangeAdjust(tls, pLower, int16(nOut)) + nNew = _whereRangeAdjust(tls, pLower, int16(int16(nOut))) nNew = _whereRangeAdjust(tls, pUpper, nNew) /* TUNING: If there is both an upper and lower limit and neither limit ** has an application-defined likelihood(), assume the range is @@ -138300,13 +138432,13 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower nNew = TLogEst(int32(nNew) - libc.Int32FromInt32(20)) } nOut -= libc.BoolInt32(pLower != uintptr(0)) + libc.BoolInt32(pUpper != uintptr(0)) - if int32(nNew) < int32(10) { + if int32(int32(nNew)) < int32(10) { nNew = int16(10) } - if int32(nNew) < nOut { - nOut = int32(nNew) + if int32(int32(nNew)) < nOut { + nOut = int32(int32(nNew)) } - (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(nOut) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(int16(nOut)) return rc } @@ -138403,7 +138535,7 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint if !(rc == SQLITE_OK && i < (*TExprList)(unsafe.Pointer(pList)).FnExpr) { break } - *(*TtRowcnt)(unsafe.Pointer(bp)) = uint64(nRow0) + *(*TtRowcnt)(unsafe.Pointer(bp)) = uint64(uint64(nRow0)) rc = _whereEqualScanEst(tls, pParse, pBuilder, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr, bp) nRowEst += *(*TtRowcnt)(unsafe.Pointer(bp)) (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid @@ -138413,8 +138545,8 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint i++ } if rc == SQLITE_OK { - if nRowEst > uint64(nRow0) { - nRowEst = uint64(nRow0) + if nRowEst > uint64(uint64(nRow0)) { + nRowEst = uint64(uint64(nRow0)) } *(*TtRowcnt)(unsafe.Pointer(pnRow)) = nRowEst } @@ -138498,7 +138630,7 @@ func _whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) (r int32) { return SQLITE_OK } n = (n + int32(7)) & ^libc.Int32FromInt32(7) - paNew = _sqlite3DbMallocRawNN(tls, db, uint64(8)*uint64(n)) + paNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(8)*uint64(uint64(n)))) if paNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -138507,7 +138639,7 @@ func _whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) (r int32) { _sqlite3DbFreeNN(tls, db, (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm) } (*TWhereLoop)(unsafe.Pointer(p)).FaLTerm = paNew - (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = uint16(n) + (*TWhereLoop)(unsafe.Pointer(p)).FnLSlot = uint16(uint16(n)) return SQLITE_OK } @@ -138995,7 +139127,7 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog } else { *(*int32)(unsafe.Pointer(bp)) = int32(20) } - if int32(iReduce) < *(*int32)(unsafe.Pointer(bp)) { + if int32(int32(iReduce)) < *(*int32)(unsafe.Pointer(bp)) { p4 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(TERM_HEURTRUTH)) iReduce = int16(*(*int32)(unsafe.Pointer(bp))) @@ -139009,8 +139141,8 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog i-- pTerm += 56 } - if int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut) > int32(nRow)-int32(iReduce) { - (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(int32(nRow) - int32(iReduce)) + if int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut) > int32(int32(nRow))-int32(int32(iReduce)) { + (*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(int32(int32(nRow)) - int32(int32(iReduce))) } } @@ -139067,7 +139199,7 @@ func _whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintpt } aff = _sqlite3CompareAffinity(tls, pRhs, _sqlite3ExprAffinity(tls, pLhs)) idxaff = _sqlite3TableColumnAffinity(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpTable, int32((*TExpr)(unsafe.Pointer(pLhs)).FiColumn)) - if int32(aff) != int32(idxaff) { + if int32(int32(aff)) != int32(int32(idxaff)) { break } pColl = _sqlite3BinaryCompareCollSeq(tls, pParse, pLhs, pRhs) @@ -139148,7 +139280,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro saved_wsFlags = (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags saved_prereq = (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq saved_nOut = (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut - pTerm = _whereScanInit(tls, bp, (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), uint32(opMask), pProbe) + pTerm = _whereScanInit(tls, bp, (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(int32(saved_nEq)), uint32(uint32(opMask)), pProbe) (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = 0 rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) rLogSize = _estLog(tls, rSize) @@ -139159,7 +139291,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro eOp = (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator /* nOut before IN() and WHERE adjustments */ nIn = 0 nRecValid = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid - if (int32(eOp) == int32(WO_ISNULL) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0) && _indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0 { + if (int32(int32(eOp)) == int32(WO_ISNULL) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0) && _indexColumnNotNull(tls, pProbe, int32(int32(saved_nEq))) != 0 { goto _1 /* ignore IS [NOT] NULL constraints on NOT NULL columns */ } if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf != 0 { @@ -139173,7 +139305,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if int32((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { goto _1 } - if int32((*TIndex)(unsafe.Pointer(pProbe)).FonError) != OE_None && int32(saved_nEq) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { + if int32((*TIndex)(unsafe.Pointer(pProbe)).FonError) != OE_None && int32(int32(saved_nEq)) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { p2 = pBuilder + 44 *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(SQLITE_BLDF1_UNIQUE)) } else { @@ -139193,7 +139325,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu16)(unsafe.Pointer(v5))++ *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(v4)*8)) = pTerm (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = (saved_prereq | (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*TWhereLoop)(unsafe.Pointer(pNew)).FmaskSelf - if int32(eOp)&int32(WO_IN) != 0 { + if int32(int32(eOp))&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nIn = int32(46) @@ -139221,7 +139353,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro nIn = int32(_sqlite3LogEst(tls, uint64((*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr))) } } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7)) != 0 && int32(rLogSize) >= int32(10) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7)) != 0 && int32(int32(rLogSize)) >= int32(10) { /* Let: ** N = the total number of rows in the table ** K = the number of entries on the RHS of the IN operator @@ -139243,12 +139375,12 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** tables (less than 2 rows) as it is pointless in that case. */ M = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2)) - logK = _estLog(tls, int16(nIn)) + logK = _estLog(tls, int16(int16(nIn))) /* TUNING v----- 10 to bias toward indexed IN */ - x = int16(int32(M) + int32(logK) + int32(10) - (nIn + int32(rLogSize))) - if int32(x) >= 0 { + x = int16(int32(int32(M)) + int32(int32(logK)) + int32(10) - (nIn + int32(int32(rLogSize)))) + if int32(int32(x)) >= 0 { } else { - if int32(nInMul) < int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SeekScan)) == uint32(0) { + if int32(int32(nInMul)) < int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SeekScan)) == uint32(0) { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_IN_SEEKSCAN) } else { goto _1 @@ -139257,11 +139389,11 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_COLUMN_IN) } else { - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { + if int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 { iCol = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_COLUMN_EQ) - if iCol == -int32(1) || iCol >= 0 && int32(nInMul) == 0 && int32(saved_nEq) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { - if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x8>>3)) != 0 || int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && int32(eOp) == int32(WO_EQ) { + if iCol == -int32(1) || iCol >= 0 && int32(int32(nInMul)) == 0 && int32(int32(saved_nEq)) == int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { + if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x8>>3)) != 0 || int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && int32(int32(eOp)) == int32(WO_EQ) { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_ONEROW) } else { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_UNQ_WANTED) @@ -139271,13 +139403,13 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_TRANSCONS) } } else { - if int32(eOp)&int32(WO_ISNULL) != 0 { + if int32(int32(eOp))&int32(WO_ISNULL) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_COLUMN_NULL) } else { - nVecLen = _whereRangeVectorLen(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm) - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 { + nVecLen = _whereRangeVectorLen(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(int32(saved_nEq)), pTerm) + if int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_BTM_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = uint16(nVecLen) + (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = uint16(uint16(nVecLen)) pBtm = pTerm pTop = uintptr(0) if int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 { @@ -139296,7 +139428,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } } else { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_TOP_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(nVecLen) + (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(uint16(nVecLen)) pTop = pTerm if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_BTM_LIMIT) != uint32(0) { v9 = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(2))*8)) @@ -139329,9 +139461,9 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*TLogEst)(unsafe.Pointer(p13)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p13))) - nIn) } else { *(*TtRowcnt)(unsafe.Pointer(bp + 112)) = uint64(0) - if int32(nInMul) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (int32(eOp)&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + if int32(int32(nInMul)) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (int32(int32(eOp))&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { pExpr1 = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if int32(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { + if int32(int32(eOp))&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { rc = _whereEqualScanEst(tls, pParse, pBuilder, (*TExpr)(unsafe.Pointer(pExpr1)).FpRight, bp+112) } else { rc = _whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr1 + 32)), bp+112) @@ -139355,7 +139487,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*uint8)(unsafe.Pointer(p15)) = uint8(int32(*(*uint8)(unsafe.Pointer(p15))) | libc.Int32FromInt32(SQLITE_BLDF2_2NDPASS)) } } - if int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) > int32(saved_nOut) { + if int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) > int32(int32(saved_nOut)) { (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut } p16 = pNew + 22 @@ -139365,7 +139497,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if *(*TtRowcnt)(unsafe.Pointer(bp + 112)) == uint64(0) { p17 = pNew + 22 *(*TLogEst)(unsafe.Pointer(p17)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p17))) + (int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq-int32(1))*2))))) - if int32(eOp)&int32(WO_ISNULL) != 0 { + if int32(int32(eOp))&int32(WO_ISNULL) != 0 { /* TUNING: If there is no likelihood() value, assume that a ** "col IS NULL" expression matches twice as many rows ** as (col=?). */ @@ -139394,9 +139526,9 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } nOutUnadjusted = (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut p19 = pNew + 20 - *(*TLogEst)(unsafe.Pointer(p19)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p19))) + (int32(nInMul) + nIn)) + *(*TLogEst)(unsafe.Pointer(p19)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p19))) + (int32(int32(nInMul)) + nIn)) p20 = pNew + 22 - *(*TLogEst)(unsafe.Pointer(p20)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p20))) + (int32(nInMul) + nIn)) + *(*TLogEst)(unsafe.Pointer(p20)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p20))) + (int32(int32(nInMul)) + nIn)) _whereLoopOutputAdjust(tls, (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize) rc = _whereLoopInsert(tls, pBuilder, pNew) if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_COLUMN_RANGE) != 0 { @@ -139408,7 +139540,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if int32((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) > int32(3) { _sqlite3ProgressCheck(tls, pParse) } - _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nInMul)+nIn)) + _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(int32(nInMul))+nIn)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid @@ -139435,7 +139567,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** the code). And, even if it is not, it should not be too much slower. ** On the other hand, the extra seeks could end up being significantly ** more expensive. */ - if v22 = int32(saved_nEq) == int32(saved_nSkip) && int32(saved_nEq)+int32(1) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) && int32(saved_nEq) == int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x40>>6)) == 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SkipScan)) == uint32(0) && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+int32(1))*2))) >= int32(42); v22 { + if v22 = int32(int32(saved_nEq)) == int32(int32(saved_nSkip)) && int32(int32(saved_nEq))+int32(1) < int32((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) && int32(int32(saved_nEq)) == int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x40>>6)) == 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x80>>7)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_SkipScan)) == uint32(0) && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(int32(saved_nEq))+int32(1))*2))) >= int32(42); v22 { v21 = _whereLoopResize(tls, db, pNew, int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) rc = v21 } @@ -139447,13 +139579,13 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu16)(unsafe.Pointer(v24))++ *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(v23)*8)) = uintptr(0) *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_SKIPSCAN) - nIter = int16(int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(saved_nEq)+int32(1))*2)))) + nIter = int16(int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(int32(int32(saved_nEq))+int32(1))*2)))) p25 = pNew + 22 - *(*TLogEst)(unsafe.Pointer(p25)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p25))) - int32(nIter)) + *(*TLogEst)(unsafe.Pointer(p25)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p25))) - int32(int32(nIter))) /* TUNING: Because uncertainties in the estimates for skip-scan queries, ** add a 1.375 fudge factor to make skip-scan slightly less likely. */ nIter = TLogEst(int32(nIter) + libc.Int32FromInt32(5)) - _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nIter)+int32(nInMul))) + _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(int32(nIter))+int32(int32(nInMul)))) (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = saved_nEq (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip @@ -139549,7 +139681,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp var i int32 var pExpr, pParse, pTerm uintptr _, _, _, _ = i, pExpr, pParse, pTerm - if int32(jointype)&int32(JT_LTORJ) != 0 { + if int32(int32(jointype))&int32(JT_LTORJ) != 0 { return 0 } pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse @@ -139569,7 +139701,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (int32(int32(jointype))&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -139665,7 +139797,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 for { - if !(i < int32(nColumn)) { + if !(i < int32(int32(nColumn))) { break } if int32(*(*Ti16)(unsafe.Pointer(aiColumn + uintptr(i)*2))) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { @@ -139763,7 +139895,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur rc = int32(WHERE_IDX_ONLY) } } - return uint32(rc) + return uint32(uint32(rc)) } // C documentation @@ -139838,7 +139970,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt return } aff = uint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pLeft)).FiColumn)*16))).Faffinity) - if int32(aff) >= int32(SQLITE_AFF_TEXT) { + if int32(int32(aff)) >= int32(SQLITE_AFF_TEXT) { if pItem != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb p = _sqlite3DbMallocRaw(tls, db, uint64(32)) @@ -139848,7 +139980,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).FiDataCur = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur = iIdxCur (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCol = int32((*TExpr)(unsafe.Pointer(pLeft)).FiColumn) - (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = uint8(bNullRow) + (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow = uint8(uint8(bNullRow)) (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext = (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p @@ -139979,7 +140111,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in ** will be more aggressive about generating automatic indexes for ** those objects, since there is no opportunity to add schema ** indexes on subqueries and views. */ - (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(int32(rLogSize) + int32(rSize)) + (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(int32(int32(rLogSize)) + int32(int32(rSize))) if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) == uint32(0) { p2 = pNew + 18 *(*TLogEst)(unsafe.Pointer(p2)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p2))) + libc.Int32FromInt32(28)) @@ -140055,7 +140187,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in ** the scarcer of the two values, and in that case an index lookup is ** better. */ - (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = int16(int32(rSize) + int32(16) - int32(2)*libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStat4) != uint32(0))) + (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = int16(int32(int32(rSize)) + int32(16) - int32(2)*libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStat4) != uint32(0))) _whereLoopOutputAdjust(tls, pWC, pNew, rSize) rc = _whereLoopInsert(tls, pBuilder, pNew) (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize @@ -140099,14 +140231,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* The cost of visiting the index rows is N*K, where K is ** between 1.1 and 3.0, depending on the relative sizes of the ** index and table rows. */ - (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = int16(int32(rSize) + int32(1) + int32(15)*int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow)) + (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = int16(int32(int32(rSize)) + int32(1) + int32(15)*int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow)) if *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { /* If this is a non-covering index scan, add in the cost of ** doing table lookups. The cost will be 3x the number of ** lookups. Take into account WHERE clause terms that can be ** satisfied using just the index, and that do not require a ** table lookup. */ - nLookup = int16(int32(rSize) + int32(16)) + nLookup = int16(int32(int32(rSize)) + int32(16)) iCur = (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor pWC2 = pWInfo + 104 ii = 0 @@ -140234,7 +140366,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, } pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*56 (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0) - if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(mExclude) == 0 && (pbRetryLimit != 0 || !(_isLimitTerm(tls, pTerm) != 0)) { + if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(int32(mExclude)) == 0 && (pbRetryLimit != 0 || !(_isLimitTerm(tls, pTerm) != 0)) { (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(1) } goto _1 @@ -140244,7 +140376,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pIdxCons += 12 } /* Initialize the output fields of the sqlite3_index_info structure */ - libc.Xmemset(tls, pUsage, 0, uint64(8)*uint64(nConstraint)) + libc.Xmemset(tls, pUsage, 0, uint64(8)*uint64(uint64(nConstraint))) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0 @@ -140266,7 +140398,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, return rc } mxTerm = -int32(1) - libc.Xmemset(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm, 0, uint64(8)*uint64(nConstraint)) + libc.Xmemset(tls, (*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm, 0, uint64(8)*uint64(uint64(nConstraint))) libc.Xmemset(tls, pNew+24, 0, uint64(24)) pIdxCons = *(*uintptr)(unsafe.Pointer(pIdxInfo + 8)) i = 0 @@ -140289,7 +140421,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mxTerm = iTerm } if (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer(pUsage + uintptr(i)*8))).Fomit != 0 { - if i < int32(16) && int32(1)< int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1) { + if int32(int32(nOrderBy)) > int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1) { return 0 } /* Cannot optimize overly large ORDER BYs */ isOrderDistinct = uint8(1) @@ -141023,20 +141155,20 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, orderDistinctMask = uint64(0) ready = uint64(0) eqOpMask = uint16(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IS) | libc.Int32FromInt32(WO_ISNULL)) - if int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_LIMIT)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)|libc.Int32FromInt32(WHERE_ORDERBY_MIN)) != 0 { + if int32(int32(wctrlFlags))&(libc.Int32FromInt32(WHERE_ORDERBY_LIMIT)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)|libc.Int32FromInt32(WHERE_ORDERBY_MIN)) != 0 { eqOpMask = Tu16(int32(eqOpMask) | libc.Int32FromInt32(WO_IN)) } iLoop = 0 for { - if !(isOrderDistinct != 0 && obSat < obDone && iLoop <= int32(nLoop)) { + if !(isOrderDistinct != 0 && obSat < obDone && iLoop <= int32(int32(nLoop))) { break } if iLoop > 0 { ready |= (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf } - if iLoop < int32(nLoop) { + if iLoop < int32(int32(nLoop)) { pLoop = *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pPath)).FaLoop + uintptr(iLoop)*8)) - if int32(wctrlFlags)&int32(WHERE_ORDERBY_LIMIT) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_ORDERBY_LIMIT) != 0 { goto _1 } } else { @@ -141050,12 +141182,12 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, FomitMask Tu16 FidxStr uintptr FmHandleIn Tu32 - })(unsafe.Pointer(pLoop + 24))).FisOrdered != 0 && int32(wctrlFlags)&(libc.Int32FromInt32(WHERE_DISTINCTBY)|libc.Int32FromInt32(WHERE_SORTBYGROUP)) != int32(WHERE_DISTINCTBY) { + })(unsafe.Pointer(pLoop + 24))).FisOrdered != 0 && int32(int32(wctrlFlags))&(libc.Int32FromInt32(WHERE_DISTINCTBY)|libc.Int32FromInt32(WHERE_SORTBYGROUP)) != int32(WHERE_DISTINCTBY) { obSat = obDone } break } else { - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_DISTINCTBY) != 0 { (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = uint16(0) } } @@ -141067,7 +141199,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, */ i = 0 for { - if !(i < int32(nOrderBy)) { + if !(i < int32(int32(nOrderBy))) { break } if libc.Uint64FromInt32(1)<u.btree.nEq constraint above. Any equality other ** than WO_IN is captured by the previous "if". So this one @@ -141225,7 +141357,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, isMatch = uint8(0) i = 0 for { - if !(bOnce != 0 && i < int32(nOrderBy)) { + if !(bOnce != 0 && i < int32(int32(nOrderBy))) { break } if libc.Uint64FromInt32(1)<= -int32(1) { @@ -141260,7 +141392,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, goto _8 } } - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_DISTINCTBY) != 0 { (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = uint16(j + int32(1)) } isMatch = uint8(1) @@ -141270,15 +141402,15 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ; i++ } - if isMatch != 0 && int32(wctrlFlags)&int32(WHERE_GROUPBY) == 0 { + if isMatch != 0 && int32(int32(wctrlFlags))&int32(WHERE_GROUPBY) == 0 { /* Make sure the sort order is compatible in an ORDER BY clause. ** Sort order is irrelevant for a GROUP BY clause. */ if revSet != 0 { - if int32(rev)^int32(revIdx) != int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) { + if int32(int32(rev))^int32(int32(revIdx)) != int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC) { isMatch = uint8(0) } } else { - rev = uint8(int32(revIdx) ^ int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC)) + rev = uint8(int32(int32(revIdx)) ^ int32((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_DESC)) if rev != 0 { *(*TBitmask)(unsafe.Pointer(pRevMask)) |= libc.Uint64FromInt32(1) << iLoop } @@ -141299,7 +141431,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat |= libc.Uint64FromInt32(1) << i } else { /* No match found */ - if j == 0 || j < int32(nKeyCol) { + if j == 0 || j < int32(int32(nKeyCol)) { isOrderDistinct = uint8(0) } break @@ -141318,7 +141450,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, orderDistinctMask |= (*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf i = 0 for { - if !(i < int32(nOrderBy)) { + if !(i < int32(int32(nOrderBy))) { break } if libc.Uint64FromInt32(1)< 0) { break @@ -141359,7 +141491,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } m = v11 if obSat&m == m { - return int8(i) + return int8(int8(i)) } goto _10 _10: @@ -141412,7 +141544,7 @@ func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int _, _ = nCol, rSortCost /* TUNING: sorting cost proportional to the number of output columns: */ nCol = _sqlite3LogEst(tls, uint64(((*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FpEList)).FnExpr+int32(59))/int32(30))) - rSortCost = int16(int32(nRow) + int32(nCol)) + rSortCost = int16(int32(int32(nRow)) + int32(int32(nCol))) if nSorted > 0 { /* Scale the result by (Y/X) */ rSortCost = TLogEst(int32(rSortCost) + (int32(_sqlite3LogEst(tls, uint64((nOrderBy-nSorted)*int32(100)/nOrderBy))) - libc.Int32FromInt32(66))) @@ -141427,14 +141559,14 @@ func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int if nSorted != 0 { rSortCost = TLogEst(int32(rSortCost) + libc.Int32FromInt32(6)) /* TUNING: Extra 1.5x if also using partial sort */ } - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow) { + if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(int32(nRow)) { nRow = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit } } else { if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { /* TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT ** reduces the number of output rows by a factor of 2 */ - if int32(nRow) > int32(10) { + if int32(int32(nRow)) > int32(10) { nRow = TLogEst(int32(nRow) - libc.Int32FromInt32(10)) } } @@ -141496,15 +141628,15 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** by the overall query. Once this estimate has been obtained, the caller ** will invoke this function a second time, passing the estimate as the ** nRowEst parameter. */ - if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) || int32(nRowEst) == 0 { + if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) || int32(int32(nRowEst)) == 0 { nOrderBy = 0 } else { nOrderBy = (*TExprList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr } /* Allocate and initialize space for aTo, aFrom and aSortCost[] */ - nSpace = int32((uint64(32) + uint64(8)*uint64(nLoop)) * uint64(mxChoice) * uint64(2)) - nSpace = int32(uint64(nSpace) + libc.Uint64FromInt64(2)*uint64(nOrderBy)) - pSpace = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nSpace)) + nSpace = int32((uint64(32) + uint64(8)*uint64(uint64(nLoop))) * uint64(uint64(mxChoice)) * uint64(2)) + nSpace = int32(uint64(nSpace) + libc.Uint64FromInt64(2)*uint64(uint64(nOrderBy))) + pSpace = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(nSpace))) if pSpace == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -141534,7 +141666,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** the ORDER BY clause are already in order, where X is the array ** index. */ aSortCost = pX - libc.Xmemset(tls, aSortCost, 0, uint64(2)*uint64(nOrderBy)) + libc.Xmemset(tls, aSortCost, 0, uint64(2)*uint64(uint64(nOrderBy))) } /* Seed the search with a single WherePath containing zero WhereLoops. ** @@ -141602,15 +141734,15 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) nOut = int16(int32((*TWherePath)(unsafe.Pointer(pFrom)).FnRow) + int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FnOut)) maskNew = (*TWherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf isOrdered = (*TWherePath)(unsafe.Pointer(pFrom)).FisOrdered - if int32(isOrdered) < 0 { + if int32(int32(isOrdered)) < 0 { *(*TBitmask)(unsafe.Pointer(bp)) = uint64(0) - isOrdered = _wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags, uint16(iLoop), pWLoop, bp) + isOrdered = _wherePathSatisfiesOrderBy(tls, pWInfo, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags, uint16(uint16(iLoop)), pWLoop, bp) } else { *(*TBitmask)(unsafe.Pointer(bp)) = (*TWherePath)(unsafe.Pointer(pFrom)).FrevLoop } - if int32(isOrdered) >= 0 && int32(isOrdered) < nOrderBy { + if int32(int32(isOrdered)) >= 0 && int32(int32(isOrdered)) < nOrderBy { if int32(*(*TLogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2))) == 0 { - *(*TLogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)) = _whereSortingCost(tls, pWInfo, nRowEst, nOrderBy, int32(isOrdered)) + *(*TLogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)) = _whereSortingCost(tls, pWInfo, nRowEst, nOrderBy, int32(int32(isOrdered))) } /* TUNING: Add a small extra penalty (3) to sorting as an ** extra encouragement to the query planner to select a plan @@ -141638,7 +141770,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) if !(jj < nTo) { break } - if (*TWherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew && (int32((*TWherePath)(unsafe.Pointer(pTo)).FisOrdered)^int32(isOrdered))&int32(0x80) == 0 { + if (*TWherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew && (int32((*TWherePath)(unsafe.Pointer(pTo)).FisOrdered)^int32(int32(isOrdered)))&int32(0x80) == 0 { break } goto _9 @@ -141649,7 +141781,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) } if jj >= nTo { /* None of the existing best-so-far paths match the candidate. */ - if nTo >= mxChoice && (int32(rCost) > int32(mxCost) || int32(rCost) == int32(mxCost) && int32(rUnsorted) >= int32(mxUnsorted)) { + if nTo >= mxChoice && (int32(int32(rCost)) > int32(int32(mxCost)) || int32(int32(rCost)) == int32(int32(mxCost)) && int32(int32(rUnsorted)) >= int32(int32(mxUnsorted))) { /* The current candidate is no better than any of the mxChoice ** paths currently in the best-so-far buffer. So discard ** this candidate as not viable. */ @@ -141676,7 +141808,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** The conditional is an expanded vector comparison equivalent to: ** (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted) */ - if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) && (int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut) || int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(rUnsorted)) { + if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) < int32(int32(rCost)) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(int32(rCost)) && (int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) < int32(int32(nOut)) || int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) == int32(int32(nOut)) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(int32(rUnsorted))) { /* Discard the candidate path from further consideration */ goto _8 } @@ -141690,7 +141822,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) (*TWherePath)(unsafe.Pointer(pTo)).FrCost = rCost (*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted (*TWherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered - libc.Xmemcpy(tls, (*TWherePath)(unsafe.Pointer(pTo)).FaLoop, (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop, uint64(8)*uint64(iLoop)) + libc.Xmemcpy(tls, (*TWherePath)(unsafe.Pointer(pTo)).FaLoop, (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop, uint64(8)*uint64(uint64(iLoop))) *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*8)) = pWLoop if nTo >= mxChoice { mxI = 0 @@ -141702,7 +141834,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) if !(jj < mxChoice) { break } - if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(mxUnsorted) { + if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) > int32(int32(mxCost)) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(int32(mxCost)) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(int32(mxUnsorted)) { mxCost = (*TWherePath)(unsafe.Pointer(pTo)).FrCost mxUnsorted = (*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted mxI = jj @@ -141892,7 +142024,7 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { if !(j < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { break } - pTerm = _whereScanInit(tls, bp, pWC, iCur, j, uint32(opMask), pIdx) + pTerm = _whereScanInit(tls, bp, pWC, iCur, j, uint32(uint32(opMask)), pIdx) for pTerm != 0 && (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight != 0 { pTerm = _whereScanNext(tls, bp) } @@ -141912,8 +142044,8 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x20>>5)) != 0 || (*TSrcItem)(unsafe.Pointer(pItem)).FcolUsed&(*TIndex)(unsafe.Pointer(pIdx)).FcolNotIdxed == uint64(0) { *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IDX_ONLY) } - (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = uint16(j) - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = uint16(j) + (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = uint16(uint16(j)) + (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = uint16(uint16(j)) (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex = pIdx /* TUNING: Cost of a unique index lookup is 15 */ (*TWhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(39) /* 39==sqlite3LogEst(15) */ @@ -142082,7 +142214,7 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi } if i != int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) { nByte = int32(uint64(int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-libc.Int32FromInt32(1)-i) * uint64(104)) - libc.Xmemmove(tls, pWInfo+856+uintptr(i)*104, pWInfo+856+uintptr(i+int32(1))*104, uint64(nByte)) + libc.Xmemmove(tls, pWInfo+856+uintptr(i)*104, pWInfo+856+uintptr(i+int32(1))*104, uint64(uint64(nByte))) } (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel-- goto _1 @@ -142134,7 +142266,7 @@ func _whereCheckIfBloomFilterIsUseful(tls *libc.TLS, pWInfo uintptr) { } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_StatsUsed) if i >= int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&reqFlags == reqFlags && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_INDEXED)) != uint32(0) { - if int32(nSearch) > int32((*TTable)(unsafe.Pointer(pTab)).FnRowLogEst) { + if int32(int32(nSearch)) > int32((*TTable)(unsafe.Pointer(pTab)).FnRowLogEst) { *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_BLOOMFILTER) *(*Tu32)(unsafe.Pointer(pLoop + 48)) &= uint32(^libc.Int32FromInt32(WHERE_IDX_ONLY)) } @@ -142374,7 +142506,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** only generate code for the first table in pTabList and assume that ** any cursors associated with subsequent tables are uninitialized. */ - if int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) != 0 { v1 = int32(1) } else { v1 = (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc @@ -142389,9 +142521,9 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere */ nByteWInfo = int32(libc.Uint64FromInt64(960)) if nTabList > int32(1) { - nByteWInfo = int32(uint64(nByteWInfo) + uint64(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) + nByteWInfo = int32(uint64(uint64(nByteWInfo)) + uint64(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) } - pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(nByteWInfo)+uint64(104)) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(uint64(nByteWInfo))+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -142404,16 +142536,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere v2 = -libc.Int32FromInt32(1) *(*int32)(unsafe.Pointer(pWInfo + 40 + 1*4)) = v2 *(*int32)(unsafe.Pointer(pWInfo + 40)) = v2 - (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = uint8(nTabList) + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = uint8(uint8(nTabList)) v3 = _sqlite3VdbeMakeLabel(tls, pParse) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = v3 (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = v3 (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags = wctrlFlags - (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit = int16(iAuxArg) + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiLimit = int16(int16(iAuxArg)) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect = pSelect libc.Xmemset(tls, pWInfo+65, 0, uint64(libc.UintptrFromInt32(0)+104)-uint64(libc.UintptrFromInt32(0)+65)) - libc.Xmemset(tls, pWInfo+856, 0, uint64(104)+uint64(nTabList)*uint64(104)) + libc.Xmemset(tls, pWInfo+856, 0, uint64(104)+uint64(uint64(nTabList))*uint64(104)) /* ONEPASS defaults to OFF */ pMaskSet = pWInfo + 592 (*TWhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 @@ -142435,7 +142567,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if pOrderBy != 0 { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8((*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) } - if int32(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_DistinctOpt)) == uint32(0) { + if int32(int32(wctrlFlags))&int32(WHERE_WANT_DISTINCT) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_DistinctOpt)) == uint32(0) { (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22542, 0) @@ -142522,7 +142654,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ; ii++ } - if int32(wctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_WANT_DISTINCT) != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_DistinctOpt)) != uint32(0) { /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via ** sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) */ @@ -142600,7 +142732,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** in-line sqlite3WhereCodeOneLoopStart() for performance reasons. */ notReady = ^libc.Uint64FromInt32(0) - if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && pResultSet != uintptr(0) && 0 == int32(wctrlFlags)&int32(WHERE_AGG_DISTINCT) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OmitNoopJoin)) == uint32(0) { + if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && pResultSet != uintptr(0) && 0 == int32(int32(wctrlFlags))&int32(WHERE_AGG_DISTINCT) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OmitNoopJoin)) == uint32(0) { notReady = _whereOmitNoopJoin(tls, pWInfo, notReady) nTabList = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) } @@ -142631,10 +142763,10 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** use a one-pass approach, and this is not set accurately for scans ** that use the OR optimization. */ - if int32(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_ONEPASS_DESIRED) != 0 { wsFlags = int32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) - if bOnerow != 0 || 0 != int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || int32(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { + if bOnerow != 0 || 0 != int32(int32(wctrlFlags))&int32(WHERE_ONEPASS_MULTIROW) && !(int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || int32(int32(wctrlFlags))&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { v12 = int32(ONEPASS_SINGLE) } else { @@ -142642,7 +142774,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = uint8(v12) if (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && wsFlags&int32(WHERE_IDX_ONLY) != 0 { - if int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { + if int32(int32(wctrlFlags))&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) @@ -142673,7 +142805,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { /* noop */ } else { - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 || int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) == uint32(0) && int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) == 0 || int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 { op = int32(OP_OpenRead) if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { op = int32(OP_OpenWrite) @@ -142698,7 +142830,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } _sqlite3VdbeChangeP4(tls, v, -int32(1), uintptr(int64(n)), -int32(3)) } - _sqlite3VdbeChangeP5(tls, v, uint16(bFordelete)) + _sqlite3VdbeChangeP5(tls, v, uint16(uint16(bFordelete))) } else { _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*TTable)(unsafe.Pointer(pTab)).FzName) } @@ -142709,7 +142841,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pIx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex op1 = int32(OP_OpenRead) /* iAuxArg is always set to a positive value if ONEPASS is possible */ - if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) != 0 { /* This is one term of an OR-optimization using the PRIMARY KEY of a ** WITHOUT ROWID table. No need for a separate index */ iIndexCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur @@ -142725,7 +142857,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere op1 = int32(OP_OpenWrite) *(*int32)(unsafe.Pointer(pWInfo + 40 + 1*4)) = iIndexCur } else { - if iAuxArg != 0 && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { + if iAuxArg != 0 && int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) != 0 { iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { @@ -142842,7 +142974,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody = _sqlite3VdbeCurrentAddr(tls, v) notReady = _sqlite3WhereCodeOneLoopStart(tls, pParse, v, pWInfo, ii, pLevel, notReady) (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrCont - if wsFlags1&int32(WHERE_MULTI_OR) == 0 && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if wsFlags1&int32(WHERE_MULTI_OR) == 0 && int32(int32(wctrlFlags))&int32(WHERE_OR_SUBCLAUSE) == 0 { _ = addrExplain } goto _25 @@ -142854,6 +142986,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -143120,10 +143253,10 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) } else { - x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) + x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(int16(x)))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(int16(x)))) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -143413,10 +143546,10 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) iVal = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) case int32(SQLITE_FLOAT): fVal = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) - if float64(int64(fVal)) != fVal { + if float64(int64(int64(fVal))) != fVal { goto error_out } - iVal = int64(fVal) + iVal = int64(int64(fVal)) default: goto error_out } @@ -143434,6 +143567,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22560, -int32(1)) @@ -143645,13 +143779,13 @@ func _ntileValueFunc(tls *libc.TLS, pCtx uintptr) { if nSize == 0 { Xsqlite3_result_int64(tls, pCtx, (*TNtileCtx)(unsafe.Pointer(p)).FiRow+int64(1)) } else { - nLarge = (*TNtileCtx)(unsafe.Pointer(p)).FnTotal - (*TNtileCtx)(unsafe.Pointer(p)).FnParam*int64(nSize) + nLarge = (*TNtileCtx)(unsafe.Pointer(p)).FnTotal - (*TNtileCtx)(unsafe.Pointer(p)).FnParam*int64(int64(nSize)) iSmall = nLarge * int64(nSize+libc.Int32FromInt32(1)) iRow = (*TNtileCtx)(unsafe.Pointer(p)).FiRow if iRow < iSmall { Xsqlite3_result_int64(tls, pCtx, int64(1)+iRow/int64(nSize+libc.Int32FromInt32(1))) } else { - Xsqlite3_result_int64(tls, pCtx, int64(1)+nLarge+(iRow-iSmall)/int64(nSize)) + Xsqlite3_result_int64(tls, pCtx, int64(1)+nLarge+(iRow-iSmall)/int64(int64(nSize))) } } } @@ -144222,7 +144356,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab - (*TExpr)(unsafe.Pointer(pExpr)).Fflags = uint32(f) + (*TExpr)(unsafe.Pointer(pExpr)).Fflags = uint32(uint32(f)) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) @@ -144648,17 +144782,18 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 if pWin == uintptr(0) { goto windowAllocErr } - (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = uint8(eType) - (*TWindow)(unsafe.Pointer(pWin)).FeStart = uint8(eStart) - (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(eEnd) - if int32(eExclude) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_WindowFunc)) != uint32(0) { + (*TWindow)(unsafe.Pointer(pWin)).FeFrmType = uint8(uint8(eType)) + (*TWindow)(unsafe.Pointer(pWin)).FeStart = uint8(uint8(eStart)) + (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(uint8(eEnd)) + if int32(int32(eExclude)) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_WindowFunc)) != uint32(0) { eExclude = uint8(TK_NO) } (*TWindow)(unsafe.Pointer(pWin)).FeExclude = eExclude - (*TWindow)(unsafe.Pointer(pWin)).FbImplicitFrame = uint8(bImplicitFrame) + (*TWindow)(unsafe.Pointer(pWin)).FbImplicitFrame = uint8(uint8(bImplicitFrame)) (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -145247,7 +145382,7 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } _sqlite3VdbeAddOp3(tls, v, v5, bInverse, regArg, (*TWindow)(unsafe.Pointer(pWin)).FregAccum) _sqlite3VdbeAppendP4(tls, v, pFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(uint8(nArg))) + _sqlite3VdbeChangeP5(tls, v, uint16(uint8(uint8(nArg)))) if (*TWindow)(unsafe.Pointer(pWin)).FbExprArgs != 0 { _sqlite3ReleaseTempRange(tls, pParse, regArg, nArg) } @@ -146787,10 +146922,10 @@ func _tokenExpr(tls *libc.TLS, pParse uintptr, op int32, _t TToken) (r uintptr) *(*TToken)(unsafe.Pointer(bp)) = _t var p, v1 uintptr _, _ = p, v1 - p = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(72)+uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)+uint64(1)) + p = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(72)+uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)+uint64(1))) if p != 0 { /* memset(p, 0, sizeof(Expr)); */ - (*TExpr)(unsafe.Pointer(p)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(p)).Fop = uint8(uint8(op)) (*TExpr)(unsafe.Pointer(p)).FaffExpr = 0 (*TExpr)(unsafe.Pointer(p)).Fflags = uint32(EP_Leaf) /* p->iAgg = -1; // Not required */ @@ -146827,7 +146962,7 @@ func _binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pA != 0 && pY != 0 && int32((*TExpr)(unsafe.Pointer(pY)).Fop) == int32(TK_NULL) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { - (*TExpr)(unsafe.Pointer(pA)).Fop = uint8(op) + (*TExpr)(unsafe.Pointer(pA)).Fop = uint8(uint8(op)) _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pA)).FpRight) (*TExpr)(unsafe.Pointer(pA)).FpRight = uintptr(0) } @@ -153148,7 +153283,7 @@ func _yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor u var pParse uintptr _ = pParse pParse = (*TyyParser)(unsafe.Pointer(yypParser)).FpParse - switch int32(yymajor) { + switch int32(int32(yymajor)) { /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a @@ -153327,21 +153462,21 @@ func _yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) (r var i, j int32 var iFallback uint16 _, _, _ = i, iFallback, j - if int32(stateno) > int32(YY_MAX_SHIFT) { + if int32(int32(stateno)) > int32(YY_MAX_SHIFT) { return stateno } for cond := true; cond; cond = int32(1) != 0 { i = int32(_yy_shift_ofst[stateno]) - i += int32(iLookAhead) - if int32(_yy_lookahead[i]) != int32(iLookAhead) { /* Fallback token */ + i += int32(int32(iLookAhead)) + if int32(_yy_lookahead[i]) != int32(int32(iLookAhead)) { /* Fallback token */ iFallback = _yyFallback[iLookAhead] - if int32(iFallback) != 0 { + if int32(int32(iFallback)) != 0 { /* Fallback loop must terminate */ iLookAhead = iFallback continue } - j = i - int32(iLookAhead) + int32(YYWILDCARD) - if int32(_yy_lookahead[j]) == int32(YYWILDCARD) && int32(iLookAhead) > 0 { + j = i - int32(int32(iLookAhead)) + int32(YYWILDCARD) + if int32(_yy_lookahead[j]) == int32(YYWILDCARD) && int32(int32(iLookAhead)) > 0 { return _yy_action[j] } return _yy_default[stateno] @@ -153362,7 +153497,7 @@ func _yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) (r var i int32 _ = i i = int32(_yy_reduce_ofst[stateno]) - i += int32(iLookAhead) + i += int32(int32(iLookAhead)) return _yy_action[i] } @@ -153405,7 +153540,7 @@ func _yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint _yyStackOverflow(tls, yypParser) return } - if int32(yyNewState) > int32(YY_MAX_SHIFT) { + if int32(int32(yyNewState)) > int32(YY_MAX_SHIFT) { yyNewState = uint16(int32(yyNewState) + (libc.Int32FromInt32(YY_MIN_REDUCE) - libc.Int32FromInt32(YY_MIN_SHIFTREDUCE))) } yytos = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -155497,14 +155632,14 @@ _135: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(2))*24+8, yymsp+8) /*A-overwrites-X*/ goto _342 _136: - ; /* xfullname ::= nm DOT nm AS nm */ + ; /* xfullname ::= nm DOT nm AS nm */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8, yymsp+uintptr(-libc.Int32FromInt32(2))*24+8) /*A-overwrites-X*/ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 8))).FzAlias = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, yymsp+8) } goto _342 _137: - ; /* xfullname ::= nm AS nm */ + ; /* xfullname ::= nm AS nm */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = _sqlite3SrcListAppend(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(2))*24+8, uintptr(0)) /*A-overwrites-X*/ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) != 0 { (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + 8))).FzAlias = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, yymsp+8) @@ -155562,7 +155697,7 @@ _149: _sqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8))) goto _342 _150: - ; /* sortlist ::= expr sortorder nulls */ + ; /* sortlist ::= expr sortorder nulls */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) /*A-overwrites-Y*/ _sqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8))) goto _342 @@ -156139,7 +156274,7 @@ _251: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(2))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8))) goto _342 _252: - ; /* eidlist ::= nm collate sortorder */ + ; /* eidlist ::= nm collate sortorder */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = _parserAddExprIdListTerm(tls, pParse, uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(2))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + 8))) /*A-overwrites-Y*/ goto _342 _253: @@ -156254,7 +156389,7 @@ _278: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _342 _279: - ; /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ + ; /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerInsertStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(4))*24+8, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*yylhsminor.yy33-overwrites-yymsp[-6].minor.yy394*/ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _342 @@ -156383,11 +156518,11 @@ _309: *(*Tu8)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = uint8(M10d_No) goto _342 _310: - ; /* wqitem ::= nm eidlist_opt wqas LP select RP */ + ; /* wqitem ::= nm eidlist_opt wqas LP select RP */ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) = _sqlite3CteNew(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(5))*24+8, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*Tu8)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8))) /*A-overwrites-X*/ goto _342 _311: - ; /* wqlist ::= wqitem */ + ; /* wqlist ::= wqitem */ *(*uintptr)(unsafe.Pointer(yymsp + 8)) = _sqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*A-overwrites-X*/ goto _342 _312: @@ -156540,14 +156675,14 @@ _342: ; yygoto = int32(_yyRuleInfoLhs[yyruleno]) yysize = int32(_yyRuleInfoNRhs[yyruleno]) - yyact = _yy_find_reduce_action(tls, (*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(yysize)*24))).Fstateno, uint16(yygoto)) + yyact = _yy_find_reduce_action(tls, (*(*TyyStackEntry)(unsafe.Pointer(yymsp + uintptr(yysize)*24))).Fstateno, uint16(uint16(yygoto))) /* There are no SHIFTREDUCE actions on nonterminals because the table ** generator has simplified them to pure REDUCE actions. */ /* It is not possible for a REDUCE to be followed by an error */ yymsp += uintptr(yysize+int32(1)) * 24 (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos = yymsp (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fstateno = yyact - (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = uint16(yygoto) + (*TyyStackEntry)(unsafe.Pointer(yymsp)).Fmajor = uint16(uint16(yygoto)) return yyact } @@ -156629,9 +156764,9 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { pParse = (*TyyParser)(unsafe.Pointer(yypParser)).FpParse yyact = (*TyyStackEntry)(unsafe.Pointer((*TyyParser)(unsafe.Pointer(yypParser)).Fyytos)).Fstateno for int32(1) != 0 { /* Exit by "break" */ - yyact = _yy_find_shift_action(tls, uint16(yymajor), yyact) - if int32(yyact) >= int32(YY_MIN_REDUCE) { - yyruleno = uint32(int32(yyact) - int32(YY_MIN_REDUCE)) /* Reduce by this rule */ + yyact = _yy_find_shift_action(tls, uint16(uint16(yymajor)), yyact) + if int32(int32(yyact)) >= int32(YY_MIN_REDUCE) { + yyruleno = uint32(int32(int32(yyact)) - int32(YY_MIN_REDUCE)) /* Reduce by this rule */ /* Check that the stack is large enough to grow by a single entry ** if the RHS of the rule is empty. This ensures that there is room ** enough on the stack to push the LHS value */ @@ -156643,11 +156778,11 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { } yyact = _yy_reduce(tls, yypParser, yyruleno, yymajor, yyminor, pParse) } else { - if int32(yyact) <= int32(YY_MAX_SHIFTREDUCE) { - _yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor) + if int32(int32(yyact)) <= int32(YY_MAX_SHIFTREDUCE) { + _yy_shift(tls, yypParser, yyact, uint16(uint16(yymajor)), yyminor) break } else { - if int32(yyact) == int32(YY_ACCEPT_ACTION) { + if int32(int32(yyact)) == int32(YY_ACCEPT_ACTION) { (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos -= 24 _yy_accept(tls, yypParser) return @@ -156661,7 +156796,7 @@ func _sqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor TToken) { ** they intend to abandon the parse upon the first syntax error seen. */ _yy_syntax_error(tls, yypParser, yymajor, yyminor) - _yy_destructor(tls, yypParser, uint16(yymajor), bp) + _yy_destructor(tls, yypParser, uint16(uint16(yymajor)), bp) break } } @@ -159072,7 +159207,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { if !(v19 != 0) { break } - if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x46) != 0 { + if int32(_sqlite3CtypeMap[uint8(uint8(c))])&int32(0x46) != 0 { n++ } else { if c == int32('(') && n > 0 { @@ -159254,7 +159389,7 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { (*(*TToken)(unsafe.Pointer(bp + 2432))).Fz = zSql - (*(*TToken)(unsafe.Pointer(bp + 2432))).Fn = uint32(n) + (*(*TToken)(unsafe.Pointer(bp + 2432))).Fn = uint32(uint32(n)) _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23703, libc.VaList(bp+2456, bp+2432)) break } @@ -159263,7 +159398,7 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { } } (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fz = zSql - (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn = uint32(n) + (*TParse)(unsafe.Pointer(pParse)).FsLastToken.Fn = uint32(uint32(n)) _sqlite3Parser(tls, pEngine, *(*int32)(unsafe.Pointer(bp)), (*TParse)(unsafe.Pointer(pParse)).FsLastToken) lastTokenParsed = *(*int32)(unsafe.Pointer(bp)) zSql += uintptr(n) @@ -159429,7 +159564,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { zSql++ } if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { - return libc.BoolInt32(int32(state) == int32(1)) + return libc.BoolInt32(int32(int32(state)) == int32(1)) } token = uint8(tkWS) case int32('['): /* Microsoft-style identifiers in [...] */ @@ -159518,7 +159653,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { state = *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_trans)) + uintptr(state)*8 + uintptr(token))) zSql++ } - return libc.BoolInt32(int32(state) == int32(1)) + return libc.BoolInt32(int32(int32(state)) == int32(1)) } /* A complex statement machine used to detect the end of a CREATE TRIGGER @@ -159716,8 +159851,8 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { return 0 } else { rc++ - a = float64(1) + float64(rc)*float64(0.1) - b = float64(1e+18) + float64(rc)*float64(25) + a = float64(1) + float64(float64(rc))*float64(0.1) + b = float64(1e+18) + float64(float64(rc))*float64(25) c = a + b return libc.BoolInt32(b != c) } @@ -159758,8 +159893,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -159771,7 +159904,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { _sqlite3MemoryBarrier(tls) return SQLITE_OK } @@ -159832,7 +159965,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -159849,7 +159982,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) _sqlite3MemoryBarrier(tls) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -159874,7 +160007,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -159889,10 +160022,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -159940,7 +160073,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -160158,7 +160291,7 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, uint64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, uint64(uint64(szAlloc))) /* IMP: R-61949-35727 */ _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -160176,7 +160309,7 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { - nBig = int32(szAlloc / int64(sz)) + nBig = int32(szAlloc / int64(int64(sz))) nSm = 0 } else { v1 = libc.Int32FromInt32(0) @@ -160188,8 +160321,8 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = pStart (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(sz) - (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue = uint16(sz) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(uint16(sz)) + (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue = uint16(uint16(sz)) if pStart != 0 { p = pStart i = 0 @@ -160490,7 +160623,7 @@ func _binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nK /* EVIDENCE-OF: R-65033-28449 The built-in BINARY collation compares ** strings byte by byte using the memcmp() function from the standard C ** library. */ - rc = libc.Xmemcmp(tls, pKey1, pKey2, uint64(n)) + rc = libc.Xmemcmp(tls, pKey1, pKey2, uint64(uint64(n))) if rc == 0 { rc = nKey1 - nKey2 } @@ -161225,7 +161358,7 @@ func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress - (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(nOps) + (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(uint32(nOps)) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = uintptr(0) @@ -161323,8 +161456,8 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i ** is being overridden/deleted but there are no active VMs, allow the ** operation to continue but invalidate all precompiled statements. */ - p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(0)) - if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == uint32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { + p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(uint8(enc)), uint8(0)) + if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == uint32(uint32(enc)) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24397, 0) return int32(SQLITE_BUSY) @@ -161338,7 +161471,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i return SQLITE_OK } } - p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(1)) + p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(uint8(enc)), uint8(1)) if !(p != 0) { return int32(SQLITE_NOMEM) } @@ -161349,7 +161482,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*TFuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor - (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | uint32(extraFlags) + (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | uint32(uint32(extraFlags)) if xSFunc != 0 { v1 = xSFunc } else { @@ -161360,7 +161493,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData - (*TFuncDef)(unsafe.Pointer(p)).FnArg = int8(uint16(nArg)) + (*TFuncDef)(unsafe.Pointer(p)).FnArg = int8(uint16(uint16(nArg))) return SQLITE_OK } @@ -161396,6 +161529,7 @@ func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, en (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } + goto out out: ; rc = _sqlite3ApiExit(tls, db, rc) @@ -161529,7 +161663,7 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, if xTrace == uintptr(0) { mTrace = uint32(0) } - (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) + (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(uint8(mTrace)) *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -162044,7 +162178,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. */ - enc2 = int32(enc) + enc2 = int32(int32(enc)) if enc2 == int32(SQLITE_UTF16) || enc2 == int32(SQLITE_UTF16_ALIGNED) { enc2 = int32(SQLITE_UTF16LE) } @@ -162055,7 +162189,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui ** sequence. If so, and there are active VMs, return busy. If there ** are no active VMs, invalidate any pre-compiled statements. */ - pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, 0) + pColl = _sqlite3FindCollSeq(tls, db, uint8(uint8(enc2)), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24532, 0) @@ -162089,14 +162223,14 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui } } } - pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, int32(1)) + pColl = _sqlite3FindCollSeq(tls, db, uint8(uint8(enc2)), zName, int32(1)) if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel - (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = uint8(enc2 | int32(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) + (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = uint8(enc2 | int32(int32(enc))&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK } @@ -162255,11 +162389,11 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for { v2 = *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) c = v2 - if !(int32(v2) != 0 && int32(c) != int32('#')) { + if !(int32(v2) != 0 && int32(int32(c)) != int32('#')) { break } iIn++ - if int32(c) == int32('%') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))])&int32(0x08) != 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn+int32(1)))))])&int32(0x08) != 0 { + if int32(int32(c)) == int32('%') && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn))))])&int32(0x08) != 0 && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn+int32(1)))))])&int32(0x08) != 0 { v3 = iIn iIn++ octet = int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(v3)))))) << int32(4) @@ -162274,16 +162408,16 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for { v5 = *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) c = v5 - if !(int32(v5) != 0 && int32(c) != int32('#') && (eState != 0 || int32(c) != int32('?')) && (eState != int32(1) || int32(c) != int32('=') && int32(c) != int32('&')) && (eState != int32(2) || int32(c) != int32('&'))) { + if !(int32(v5) != 0 && int32(int32(c)) != int32('#') && (eState != 0 || int32(int32(c)) != int32('?')) && (eState != int32(1) || int32(int32(c)) != int32('=') && int32(int32(c)) != int32('&')) && (eState != int32(2) || int32(int32(c)) != int32('&'))) { break } iIn++ } continue } - c = int8(octet) + c = int8(int8(octet)) } else { - if eState == int32(1) && (int32(c) == int32('&') || int32(c) == int32('=')) { + if eState == int32(1) && (int32(int32(c)) == int32('&') || int32(int32(c)) == int32('=')) { if int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iOut-int32(1))))) == 0 { /* An empty option name. Ignore this option altogether. */ for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('#') && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn-int32(1))))) != int32('&') { @@ -162291,7 +162425,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } continue } - if int32(c) == int32('&') { + if int32(int32(c)) == int32('&') { v6 = iOut iOut++ *(*int8)(unsafe.Pointer(zFile + uintptr(v6))) = int8('\000') @@ -162300,7 +162434,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } c = 0 } else { - if eState == 0 && int32(c) == int32('?') || eState == int32(2) && int32(c) == int32('&') { + if eState == 0 && int32(int32(c)) == int32('?') || eState == int32(2) && int32(int32(c)) == int32('&') { c = 0 eState = int32(1) } @@ -162341,7 +162475,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24669, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) - limit = int32(uint32(mask) & flags) + limit = int32(uint32(uint32(mask)) & flags) zModeType = __ccgo_ts + 3408 } if aMode != 0 { @@ -162358,7 +162492,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u Fz uintptr Fmode int32 })(unsafe.Pointer(aMode + uintptr(i)*16))).Fz - if nVal == _sqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, uint64(nVal)) { + if nVal == _sqlite3Strlen30(tls, z) && 0 == libc.Xmemcmp(tls, zVal, z, uint64(uint64(nVal))) { mode = (*(*struct { Fz uintptr Fmode int32 @@ -162380,7 +162514,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u rc = int32(SQLITE_PERM) goto parse_uri_out } - flags = flags&uint32(^mask) | uint32(mode) + flags = flags&uint32(^mask) | uint32(uint32(mode)) } } zOpt = zVal + uintptr(nVal+int32(1)) @@ -162393,7 +162527,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u libc.Xmemset(tls, zFile, 0, uint64(4)) zFile += uintptr(4) if nUri != 0 { - libc.Xmemcpy(tls, zFile, zUri, uint64(nUri)) + libc.Xmemcpy(tls, zFile, zUri, uint64(uint64(nUri))) } libc.Xmemset(tls, zFile+uintptr(nUri), 0, uint64(4)) flags &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_URI)) @@ -162403,6 +162537,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24728, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } + goto parse_uri_out parse_uri_out: ; if rc != SQLITE_OK { @@ -162679,6 +162814,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* Enable the lookaside-malloc subsystem */ _setupLookaside(tls, db, uintptr(0), _sqlite3Config.FszLookaside, _sqlite3Config.FnLookaside) Xsqlite3_wal_autocheckpoint(tls, db, int32(SQLITE_DEFAULT_WAL_AUTOCHECKPOINT)) + goto opendb_out opendb_out: ; if db != 0 { @@ -162708,7 +162844,7 @@ func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { } func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) (r int32) { - return _openDatabase(tls, filename, ppDb, uint32(flags), zVfs) + return _openDatabase(tls, filename, ppDb, uint32(uint32(flags)), zVfs) } // C documentation @@ -162764,7 +162900,7 @@ func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, uint8(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, uint8(uint8(enc)), pCtx, xCompare, xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -162783,7 +162919,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, uint8(uint8(enc)), pCtx, xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -162887,7 +163023,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(32)+n+uint64(1))) if p == uintptr(0) { if xDestructor != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) @@ -163063,6 +163199,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if !(zCollSeq != 0) { zCollSeq = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } + goto error_out error_out: ; _sqlite3BtreeLeaveAll(tls, db) @@ -163268,7 +163405,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { if v2 && v1 != 0 { x = y } - _sqlite3Config.FiPrngSeed = uint32(x) + _sqlite3Config.FiPrngSeed = uint32(uint32(x)) Xsqlite3_randomness(tls, 0, uintptr(0)) break /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); @@ -163351,7 +163488,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { rc = _sqlite3PendingByte newVal = libc.VaUint32(&ap) if newVal != 0 { - _sqlite3PendingByte = int32(newVal) + _sqlite3PendingByte = int32(int32(newVal)) } break /* @@ -163526,7 +163663,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { */ fallthrough case int32(SQLITE_TESTCTRL_ISINIT): - if _sqlite3Config.FisInit == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 { rc = int32(SQLITE_ERROR) } break @@ -163552,7 +163689,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db5)).Fmutex) iDb = _sqlite3FindDbName(tls, db5, libc.VaUintptr(&ap)) if iDb >= 0 { - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FiDb = uint8(iDb) + (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FiDb = uint8(uint8(iDb)) (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy = uint8(libc.AssignBitFieldPtr8Uint32(db5+192+8, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum = uint32(libc.VaInt32(&ap)) if int32((*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy) == 0 && (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum > uint32(0) { @@ -163633,7 +163770,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { pI1 = libc.VaUintptr(&ap) pU64 = libc.VaUintptr(&ap) pI2 = libc.VaUintptr(&ap) - *(*int32)(unsafe.Pointer(pI1)) = int32(rLogEst) + *(*int32)(unsafe.Pointer(pI1)) = int32(int32(rLogEst)) *(*Tu64)(unsafe.Pointer(pU64)) = _sqlite3LogEstToInt(tls, rLogEst) *(*int32)(unsafe.Pointer(pI2)) = int32(_sqlite3LogEst(tls, *(*Tu64)(unsafe.Pointer(pU64)))) break @@ -163726,13 +163863,13 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; i++ } - v2 = Xsqlite3_malloc64(tls, uint64(nByte)) + v2 = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) p = v2 pResult = v2 if p == uintptr(0) { @@ -163848,7 +163985,7 @@ func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDfl z = Xsqlite3_uri_parameter(tls, zFilename, zParam) bDflt = libc.BoolInt32(bDflt != 0) if z != 0 { - v1 = int32(_sqlite3GetBoolean(tls, z, uint8(bDflt))) + v1 = int32(_sqlite3GetBoolean(tls, z, uint8(uint8(bDflt)))) } else { v1 = bDflt } @@ -164412,9 +164549,9 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == int32(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == int32(uint64(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, uint64(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(uint64(uint64(nArg))*uint64(8)*uint64(2))) if pNew != 0 { - libc.Xmemcpy(tls, pNew, aArg, uint64(nArg)*uint64(8)) + libc.Xmemcpy(tls, pNew, aArg, uint64(uint64(nArg))*uint64(8)) Xsqlite3_free(tls, aDyn) v2 = pNew aArg = v2 @@ -165753,7 +165890,7 @@ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { if (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8)))).FnJson != nJson { goto _2 } - if libc.Xmemcmp(tls, (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8)))).FzJson, zJson, uint64(nJson)) == 0 { + if libc.Xmemcmp(tls, (*TJsonParse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8)))).FzJson, zJson, uint64(uint64(nJson))) == 0 { break } goto _2 @@ -165840,10 +165977,10 @@ func _jsonStringGrow(tls *libc.TLS, p uintptr, N Tu32) (r int32) { var zNew, p2 uintptr var v1 uint64 _, _, _, _ = nTotal, zNew, v1, p2 - if uint64(N) < (*TJsonString)(unsafe.Pointer(p)).FnAlloc { + if uint64(uint64(N)) < (*TJsonString)(unsafe.Pointer(p)).FnAlloc { v1 = (*TJsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2) } else { - v1 = (*TJsonString)(unsafe.Pointer(p)).FnAlloc + uint64(N) + uint64(10) + v1 = (*TJsonString)(unsafe.Pointer(p)).FnAlloc + uint64(uint64(N)) + uint64(10) } nTotal = v1 if (*TJsonString)(unsafe.Pointer(p)).FbStatic != 0 { @@ -165855,7 +165992,7 @@ func _jsonStringGrow(tls *libc.TLS, p uintptr, N Tu32) (r int32) { _jsonStringOom(tls, p) return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, zNew, (*TJsonString)(unsafe.Pointer(p)).FzBuf, (*TJsonString)(unsafe.Pointer(p)).FnUsed) + libc.Xmemcpy(tls, zNew, (*TJsonString)(unsafe.Pointer(p)).FzBuf, uint64((*TJsonString)(unsafe.Pointer(p)).FnUsed)) (*TJsonString)(unsafe.Pointer(p)).FzBuf = zNew (*TJsonString)(unsafe.Pointer(p)).FbStatic = uint8(0) } else { @@ -165879,28 +166016,28 @@ func _jsonStringExpandAndAppend(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { if _jsonStringGrow(tls, p, N) != 0 { return } - libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(N)) - *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(N) + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(uint64(N))) + *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(uint64(N)) } func _jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { if N == uint32(0) { return } - if uint64(N)+(*TJsonString)(unsafe.Pointer(p)).FnUsed >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc { + if uint64(uint64(N))+(*TJsonString)(unsafe.Pointer(p)).FnUsed >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc { _jsonStringExpandAndAppend(tls, p, zIn, N) } else { - libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(N)) - *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(N) + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(uint64(N))) + *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(uint64(N)) } } func _jsonAppendRawNZ(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { - if uint64(N)+(*TJsonString)(unsafe.Pointer(p)).FnUsed >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc { + if uint64(uint64(N))+(*TJsonString)(unsafe.Pointer(p)).FnUsed >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc { _jsonStringExpandAndAppend(tls, p, zIn, N) } else { - libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(N)) - *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(N) + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), zIn, uint64(uint64(N))) + *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(uint64(N)) } } @@ -165911,7 +166048,7 @@ func _jsonAppendRawNZ(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { func _jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { var ap Tva_list _ = ap - if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, uint32(N)) != 0 { + if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(uint64(N)) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, uint32(uint32(N))) != 0 { return } ap = va @@ -165986,7 +166123,7 @@ func _jsonAppendSeparator(tls *libc.TLS, p uintptr) { return } c = *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed-uint64(1)))) - if int32(c) == int32('[') || int32(c) == int32('{') { + if int32(int32(c)) == int32('[') || int32(int32(c)) == int32('{') { return } _jsonAppendChar(tls, p, int8(',')) @@ -166012,7 +166149,7 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { if z == uintptr(0) { return } - if uint64(N)+(*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(2)) != 0 { + if uint64(uint64(N))+(*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2) >= (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(2)) != 0 { return } v2 = p + 24 @@ -166052,24 +166189,25 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { } if k >= N { if k > uint32(0) { - libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), z, uint64(k)) - *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(k) + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), z, uint64(uint64(k))) + *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(uint64(k)) } break } if k > uint32(0) { - libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), z, uint64(k)) - *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(k) + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(p)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed), z, uint64(uint64(k))) + *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(uint64(k)) z += uintptr(k) N -= k } c = *(*Tu8)(unsafe.Pointer(z)) - if !(int32(c) == int32('"') || int32(c) == int32('\\')) { + if !(int32(int32(c)) == int32('"') || int32(int32(c)) == int32('\\')) { goto _3 } + goto json_simple_escape json_simple_escape: ; - if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N)+uint64(3) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { + if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(uint64(N))+uint64(3) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { return } v6 = p + 24 @@ -166079,21 +166217,21 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { v8 = p + 24 v7 = *(*Tu64)(unsafe.Pointer(v8)) *(*Tu64)(unsafe.Pointer(v8))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v7))) = int8(c) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v7))) = int8(int8(c)) goto _4 _3: ; - if int32(c) == int32('\'') { + if int32(int32(c)) == int32('\'') { v10 = p + 24 v9 = *(*Tu64)(unsafe.Pointer(v10)) *(*Tu64)(unsafe.Pointer(v10))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v9))) = int8(c) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v9))) = int8(int8(c)) } else { if _aSpecial[c] != 0 { c = uint8(_aSpecial[c]) goto json_simple_escape } - if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(N)+uint64(7) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(7)) != 0 { + if (*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(uint64(N))+uint64(7) > (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(7)) != 0 { return } v12 = p + 24 @@ -166115,11 +166253,11 @@ func _jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N Tu32) { v20 = p + 24 v19 = *(*Tu64)(unsafe.Pointer(v20)) *(*Tu64)(unsafe.Pointer(v20))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v19))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 24894 + uintptr(int32(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v19))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 24894 + uintptr(int32(int32(c))>>int32(4)))) v22 = p + 24 v21 = *(*Tu64)(unsafe.Pointer(v22)) *(*Tu64)(unsafe.Pointer(v22))++ - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v21))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 24894 + uintptr(int32(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr(v21))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 24894 + uintptr(int32(int32(c))&int32(0xf)))) } _4: ; @@ -166414,10 +166552,10 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { if !(int32(v3) != 0) { break } - if int32(c) == int32('\n') || int32(c) == int32('\r') { + if int32(int32(c)) == int32('\n') || int32(int32(c)) == int32('\r') { break } - if int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(1))))) && (int32(0xa8) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2))))) || int32(0xa9) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2)))))) { + if int32(0xe2) == int32(uint8(uint8(c))) && int32(0x80) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(1))))) && (int32(0xa8) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2))))) || int32(0xa9) == int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j1+int32(2)))))) { j1 += int32(2) break } @@ -166449,10 +166587,10 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { case int32(0xe2): if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(1))))) == int32(0x80) { c1 = *(*Tu8)(unsafe.Pointer(z + uintptr(n+int32(2)))) - if int32(c1) < int32(0x80) { + if int32(int32(c1)) < int32(0x80) { goto whitespace_done } - if int32(c1) <= int32(0x8a) || int32(c1) == int32(0xa8) || int32(c1) == int32(0xa9) || int32(c1) == int32(0xaf) { + if int32(int32(c1)) <= int32(0x8a) || int32(int32(c1)) == int32(0xa8) || int32(int32(c1)) == int32(0xa9) || int32(int32(c1)) == int32(0xaf) { n += int32(3) break } @@ -166479,6 +166617,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -166591,7 +166730,7 @@ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { if t < N { t = N + uint32(100) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(uint64(t))) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) @@ -166693,21 +166832,21 @@ func _jsonBlobAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPayload Tu3 } a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) if szPayload <= uint32(11) { - *(*Tu8)(unsafe.Pointer(a)) = uint8(uint32(eType) | szPayload<> libc.Int32FromInt32(8) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload & uint32(0xff)) *(*Tu32)(unsafe.Pointer(pParse + 8)) += uint32(3) } else { - *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(eType) | int32(0xe0)) + *(*Tu8)(unsafe.Pointer(a)) = uint8(int32(int32(eType)) | int32(0xe0)) *(*Tu8)(unsafe.Pointer(a + 1)) = uint8(szPayload >> libc.Int32FromInt32(24) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload >> libc.Int32FromInt32(16) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 3)) = uint8(szPayload >> libc.Int32FromInt32(8) & uint32(0xff)) @@ -166718,7 +166857,7 @@ func _jsonBlobAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPayload Tu3 } if aPayload != 0 { *(*Tu32)(unsafe.Pointer(pParse + 8)) += szPayload - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-szPayload), aPayload, uint64(szPayload)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-szPayload), aPayload, uint64(uint64(szPayload))) } } @@ -166737,13 +166876,13 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload } a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i) szType = uint8(int32(*(*Tu8)(unsafe.Pointer(a))) >> int32(4)) - if int32(szType) <= int32(11) { + if int32(int32(szType)) <= int32(11) { nExtra = uint8(0) } else { - if int32(szType) == int32(12) { + if int32(int32(szType)) == int32(12) { nExtra = uint8(1) } else { - if int32(szType) == int32(13) { + if int32(int32(szType)) == int32(13) { nExtra = uint8(2) } else { nExtra = uint8(4) @@ -166763,9 +166902,9 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload } } } - delta = int32(nNeeded) - int32(nExtra) + delta = int32(int32(nNeeded)) - int32(int32(nExtra)) if delta != 0 { - newSize = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + uint32(delta) + newSize = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob + uint32(uint32(delta)) if delta > 0 { if newSize > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc && _jsonBlobExpand(tls, pParse, newSize) != 0 { return 0 /* OOM error. Error state recorded in pParse->oom. */ @@ -166773,18 +166912,18 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload a = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i) libc.Xmemmove(tls, a+uintptr(int32(1)+delta), a+1, uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1)))) } else { - libc.Xmemmove(tls, a+1, a+uintptr(int32(1)-delta), uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1)-uint32(delta)))) + libc.Xmemmove(tls, a+1, a+uintptr(int32(1)-delta), uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-(i+uint32(1)-uint32(uint32(delta))))) } (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = newSize } - if int32(nNeeded) == 0 { + if int32(int32(nNeeded)) == 0 { *(*Tu8)(unsafe.Pointer(a)) = uint8(uint32(int32(*(*Tu8)(unsafe.Pointer(a)))&libc.Int32FromInt32(0x0f)) | szPayload<> libc.Int32FromInt32(8) & uint32(0xff)) *(*Tu8)(unsafe.Pointer(a + 2)) = uint8(szPayload & uint32(0xff)) @@ -166853,7 +166992,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } /* Checked by caller */ z = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob x = uint8(int32(*(*Tu8)(unsafe.Pointer(z + uintptr(i)))) & int32(0x0f)) - switch int32(x) { + switch int32(int32(x)) { case JSONB_NULL: fallthrough case int32(JSONB_TRUE): @@ -166928,7 +167067,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } } if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { - if int32(x) == int32(JSONB_FLOAT) { + if int32(int32(x)) == int32(JSONB_FLOAT) { return j + uint32(1) } if !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) { @@ -166937,7 +167076,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept j += uint32(2) seen = uint8(1) } else { - if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('0') && int32(x) == int32(JSONB_FLOAT) { + if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('0') && int32(int32(x)) == int32(JSONB_FLOAT) { if j+uint32(3) > k { return j + uint32(1) } @@ -166955,17 +167094,17 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept goto _2 } if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('.') { - if int32(seen) > 0 { + if int32(int32(seen)) > 0 { return j + uint32(1) } - if int32(x) == int32(JSONB_FLOAT) && (j == k-uint32(1) || !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0)) { + if int32(int32(x)) == int32(JSONB_FLOAT) && (j == k-uint32(1) || !(int32(_sqlite3CtypeMap[*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0)) { return j + uint32(1) } seen = uint8(1) goto _2 } if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('e') || int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('E') { - if int32(seen) == int32(2) { + if int32(int32(seen)) == int32(2) { return j + uint32(1) } if j == k-uint32(1) { @@ -166986,7 +167125,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept ; j++ } - if int32(seen) == 0 { + if int32(int32(seen)) == 0 { return i + uint32(1) } return uint32(0) @@ -167008,7 +167147,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept for j < k { if !(_jsonIsOk[*(*Tu8)(unsafe.Pointer(z + uintptr(j)))] != 0) && int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\'') { if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) == int32('"') { - if int32(x) == int32(JSONB_TEXTJ) { + if int32(int32(x)) == int32(JSONB_TEXTJ) { return j + uint32(1) } } else { @@ -167027,7 +167166,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } j++ } else { - if int32(x) != int32(JSONB_TEXT5) { + if int32(int32(x)) != int32(JSONB_TEXT5) { return j + uint32(1) } else { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(0) @@ -167081,7 +167220,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept } if cnt&uint32(1) == uint32(0) { x = uint8(int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) & int32(0x0f)) - if int32(x) < int32(JSONB_TEXT) || int32(x) > int32(JSONB_TEXTRAW) { + if int32(int32(x)) < int32(JSONB_TEXT) || int32(int32(x)) > int32(JSONB_TEXTRAW) { return j + uint32(1) } } @@ -167131,6 +167270,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -167244,7 +167384,7 @@ _1: for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(k))))])&int32(0x46) != 0 && _json5Whitespace(tls, z+uintptr(k)) == 0 || int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))) == int32('\\') && _jsonIs4HexB(tls, z+uintptr(k+int32(1)), bp) != 0 { k++ } - _jsonBlobAppendNode(tls, pParse, uint8(*(*int32)(unsafe.Pointer(bp))), uint32(k)-j, z+uintptr(j)) + _jsonBlobAppendNode(tls, pParse, uint8(*(*int32)(unsafe.Pointer(bp))), uint32(uint32(k))-j, z+uintptr(j)) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) x = k } else { @@ -167258,11 +167398,11 @@ _1: return -int32(1) } t = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iBlob)))) & int32(0x0f)) - if int32(t) < int32(JSONB_TEXT) || int32(t) > int32(JSONB_TEXTRAW) { + if int32(int32(t)) < int32(JSONB_TEXT) || int32(int32(t)) > int32(JSONB_TEXTRAW) { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } - j = uint32(x) + j = uint32(uint32(x)) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(':') { j++ } else { @@ -167285,6 +167425,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -167294,7 +167435,7 @@ _1: } return -int32(1) } - j = uint32(x) + j = uint32(uint32(x)) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _42 } else { @@ -167364,7 +167505,7 @@ _2: } return -int32(1) } - j = uint32(x) + j = uint32(uint32(x)) if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == int32(',') { goto _45 } else { @@ -167411,6 +167552,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -167429,23 +167571,23 @@ parse_string: } } c = *(*int8)(unsafe.Pointer(z + uintptr(j))) - if int32(c) == int32(cDelim) { + if int32(int32(c)) == int32(int32(cDelim)) { break } else { - if int32(c) == int32('\\') { + if int32(int32(c)) == int32('\\') { j++ v46 = j c = *(*int8)(unsafe.Pointer(z + uintptr(v46))) - if int32(c) == int32('"') || int32(c) == int32('\\') || int32(c) == int32('/') || int32(c) == int32('b') || int32(c) == int32('f') || int32(c) == int32('n') || int32(c) == int32('r') || int32(c) == int32('t') || int32(c) == int32('u') && _jsonIs4Hex(tls, z+uintptr(j+uint32(1))) != 0 { - if int32(opcode) == int32(JSONB_TEXT) { + if int32(int32(c)) == int32('"') || int32(int32(c)) == int32('\\') || int32(int32(c)) == int32('/') || int32(int32(c)) == int32('b') || int32(int32(c)) == int32('f') || int32(int32(c)) == int32('n') || int32(int32(c)) == int32('r') || int32(int32(c)) == int32('t') || int32(int32(c)) == int32('u') && _jsonIs4Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(int32(opcode)) == int32(JSONB_TEXT) { opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(int32(c)) == int32('\'') || int32(int32(c)) == int32('0') || int32(int32(c)) == int32('v') || int32(int32(c)) == int32('\n') || int32(0xe2) == int32(uint8(uint8(c))) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(int32(c)) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { - if int32(c) == int32('\r') { + if int32(int32(c)) == int32('\r') { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('\n') { j++ } @@ -167458,12 +167600,12 @@ parse_string: } } } else { - if int32(c) <= int32(0x1f) { + if int32(int32(c)) <= int32(0x1f) { /* Control characters are not allowed in strings */ (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } else { - if int32(c) == int32('"') { + if int32(int32(c)) == int32('"') { opcode = uint8(JSONB_TEXT5) } } @@ -167528,12 +167670,13 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) c = *(*int8)(unsafe.Pointer(z + uintptr(i))) - if int32(c) <= int32('0') { - if int32(c) == int32('0') { + if int32(int32(c)) <= int32('0') { + if int32(int32(c)) == int32('0') { if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('x') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('X')) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(2)))))])&int32(0x08) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) t = uint8(0x01) @@ -167605,6 +167748,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -167613,15 +167757,15 @@ parse_number_2: if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x04) != 0 { goto _50 } - if int32(c) == int32('.') { - if int32(t)&int32(0x02) != 0 { + if int32(int32(c)) == int32('.') { + if int32(int32(t))&int32(0x02) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } t = Tu8(int32(t) | libc.Int32FromInt32(0x02)) goto _50 } - if int32(c) == int32('e') || int32(c) == int32('E') { + if int32(int32(c)) == int32('e') || int32(int32(c)) == int32('E') { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) < int32('0') { if int32(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(1))))) == int32('.') && j-uint32(2) >= i && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j-uint32(2)))))])&int32(0x04) != 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) @@ -167638,11 +167782,11 @@ parse_number_2: t = Tu8(int32(t) | libc.Int32FromInt32(0x02)) seenE = uint8(1) c = *(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))) - if int32(c) == int32('+') || int32(c) == int32('-') { + if int32(int32(c)) == int32('+') || int32(int32(c)) == int32('-') { j++ c = *(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))) } - if int32(c) < int32('0') || int32(c) > int32('9') { + if int32(int32(c)) < int32('0') || int32(int32(c)) > int32('9') { (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = j return -int32(1) } @@ -167663,13 +167807,14 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { i++ } - _jsonBlobAppendNode(tls, pParse, uint8(int32(JSONB_INT)+int32(t)), j-i, z+uintptr(i)) - return int32(j) + _jsonBlobAppendNode(tls, pParse, uint8(int32(JSONB_INT)+int32(int32(t))), j-i, z+uintptr(i)) + return int32(int32(j)) _20: ; (*TJsonParse)(unsafe.Pointer(pParse)).FiErr = i @@ -167735,17 +167880,17 @@ _38: c = *(*int8)(unsafe.Pointer(z + uintptr(i))) k1 = uint32(0) for { - if !(uint64(k1) < libc.Uint64FromInt64(120)/libc.Uint64FromInt64(24)) { + if !(uint64(uint64(k1)) < libc.Uint64FromInt64(120)/libc.Uint64FromInt64(24)) { break } - if int32(c) != int32(_aNanInfName[k1].Fc1) && int32(c) != int32(_aNanInfName[k1].Fc2) { + if int32(int32(c)) != int32(_aNanInfName[k1].Fc1) && int32(int32(c)) != int32(_aNanInfName[k1].Fc2) { goto _51 } nn = int32(_aNanInfName[k1].Fn) if Xsqlite3_strnicmp(tls, z+uintptr(i), _aNanInfName[k1].FzMatch, nn) != 0 { goto _51 } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(nn)))))])&int32(0x06) != 0 { + if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(uint32(nn))))))])&int32(0x06) != 0 { goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { @@ -167754,7 +167899,7 @@ _38: _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) - return int32(i + uint32(nn)) + return int32(i + uint32(uint32(nn))) goto _51 _51: ; @@ -167861,11 +168006,11 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu return uint32(0) } x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) - if int32(x) <= int32(11) { - sz = uint32(x) + if int32(int32(x)) <= int32(11) { + sz = uint32(uint32(x)) n = uint32(1) } else { - if int32(x) == int32(12) { + if int32(int32(x)) == int32(12) { if i+uint32(1) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) @@ -167873,7 +168018,7 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu sz = uint32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1))))) n = uint32(2) } else { - if int32(x) == int32(13) { + if int32(int32(x)) == int32(13) { if i+uint32(2) >= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) @@ -167881,7 +168026,7 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu sz = uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(1)))))<= (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) @@ -167899,7 +168044,7 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu } } } - if int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { + if int64(int64(i))+int64(int64(sz))+int64(int64(n)) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && int64(int64(i))+int64(int64(sz))+int64(int64(n)) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { sz = uint32(0) n = uint32(0) } @@ -168199,6 +168344,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -168239,18 +168385,18 @@ func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { } libc.Xmemset(tls, bp+8, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = uint32(nBlob) + (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = uint32(uint32(nBlob)) n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) if n == uint32(0) { return 0 } - if *(*Tu32)(unsafe.Pointer(bp))+n != uint32(nBlob) { + if *(*Tu32)(unsafe.Pointer(bp))+n != uint32(uint32(nBlob)) { return 0 } if int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { return 0 } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == uint32(nBlob)) + return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == uint32(uint32(nBlob))) } // C documentation @@ -168323,7 +168469,7 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var d Ti64 var p1, p2 uintptr _, _, _ = d, p1, p2 - d = int64(nIns) - int64(nDel) + d = int64(int64(nIns)) - int64(int64(nDel)) if d != 0 { if int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, uint32(int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -168338,7 +168484,7 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin *(*int32)(unsafe.Pointer(p2)) = int32(int64(*(*int32)(unsafe.Pointer(p2))) + d) } if nIns != 0 && aIns != 0 { - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, uint64(nIns)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, uint64(uint64(nIns))) } } @@ -168477,7 +168623,7 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu return nSkip + _jsonUnescapeOneChar(tls, z+uintptr(nSkip), n-nSkip, piOut) } else { sz = _sqlite3Utf8ReadLimited(tls, z+uintptr(nSkip), int32(n-nSkip), piOut) - return nSkip + uint32(sz) + return nSkip + uint32(uint32(sz)) } } } @@ -168513,9 +168659,9 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft if rawLeft != 0 || int32(*(*int8)(unsafe.Pointer(zLeft))) != int32('\\') { *(*Tu32)(unsafe.Pointer(bp)) = uint32(*(*Tu8)(unsafe.Pointer(zLeft))) if *(*Tu32)(unsafe.Pointer(bp)) >= uint32(0xc0) { - sz = _sqlite3Utf8ReadLimited(tls, zLeft, int32(nLeft), bp) + sz = _sqlite3Utf8ReadLimited(tls, zLeft, int32(int32(nLeft)), bp) zLeft += uintptr(sz) - nLeft -= uint32(sz) + nLeft -= uint32(uint32(sz)) } else { zLeft++ nLeft-- @@ -168532,9 +168678,9 @@ func _jsonLabelCompareEscaped(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft if rawRight != 0 || int32(*(*int8)(unsafe.Pointer(zRight))) != int32('\\') { *(*Tu32)(unsafe.Pointer(bp + 4)) = uint32(*(*Tu8)(unsafe.Pointer(zRight))) if *(*Tu32)(unsafe.Pointer(bp + 4)) >= uint32(0xc0) { - sz1 = _sqlite3Utf8ReadLimited(tls, zRight, int32(nRight), bp+4) + sz1 = _sqlite3Utf8ReadLimited(tls, zRight, int32(int32(nRight)), bp+4) zRight += uintptr(sz1) - nRight -= uint32(sz1) + nRight -= uint32(uint32(sz1)) } else { zRight++ nRight-- @@ -168568,7 +168714,7 @@ func _jsonLabelCompare(tls *libc.TLS, zLeft uintptr, nLeft Tu32, rawLeft int32, if nLeft != nRight { return 0 } - return libc.BoolInt32(libc.Xmemcmp(tls, zLeft, zRight, uint64(nLeft)) == 0) + return libc.BoolInt32(libc.Xmemcmp(tls, zLeft, zRight, uint64(uint64(nLeft))) == 0) } else { return _jsonLabelCompareEscaped(tls, zLeft, nLeft, rawLeft, zRight, nRight, rawRight) } @@ -168618,7 +168764,7 @@ func _jsonCreateEditSubstructure(tls *libc.TLS, pParse uintptr, pIns uintptr, zT p1 = pParse + 47 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) | int32((*TJsonParse)(unsafe.Pointer(pIns)).Foom)) } - return uint32(rc) /* Error code only */ + return uint32(uint32(rc)) /* Error code only */ } var _emptyObject = [2]Tu8{ @@ -168702,7 +168848,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i } else { return uint32(JSON_LOOKUP_PATHERROR) } - rawKey = libc.BoolInt32(libc.Xmemchr(tls, zKey, int32('\\'), uint64(nKey)) == uintptr(0)) + rawKey = libc.BoolInt32(libc.Xmemchr(tls, zKey, int32('\\'), uint64(uint64(nKey))) == uintptr(0)) } else { zKey = zPath i = uint32(0) @@ -168720,7 +168866,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i return uint32(JSON_LOOKUP_PATHERROR) } } - if int32(x)&int32(0x0f) != int32(JSONB_OBJECT) { + if int32(int32(x))&int32(0x0f) != int32(JSONB_OBJECT) { return uint32(JSON_LOOKUP_NOTFOUND) } n = _jsonbPayloadSize(tls, pParse, iRoot, bp) @@ -168728,7 +168874,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i iEnd = j + *(*Tu32)(unsafe.Pointer(bp)) for j < iEnd { x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(j)))) & int32(0x0f)) - if int32(x) < int32(JSONB_TEXT) || int32(x) > int32(JSONB_TEXTRAW) { + if int32(int32(x)) < int32(JSONB_TEXT) || int32(int32(x)) > int32(JSONB_TEXTRAW) { return uint32(JSON_LOOKUP_ERROR) } n = _jsonbPayloadSize(tls, pParse, j, bp) @@ -168740,7 +168886,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i return uint32(JSON_LOOKUP_ERROR) } zLabel = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(k) - rawLabel = libc.BoolInt32(int32(x) == int32(JSONB_TEXT) || int32(x) == int32(JSONB_TEXTRAW)) + rawLabel = libc.BoolInt32(int32(int32(x)) == int32(JSONB_TEXT) || int32(int32(x)) == int32(JSONB_TEXTRAW)) if _jsonLabelCompare(tls, zKey, nKey, rawKey, zLabel, *(*Tu32)(unsafe.Pointer(bp)), rawLabel) != 0 { v = k + *(*Tu32)(unsafe.Pointer(bp)) /* v is the index of the value */ if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(v))))&int32(0x0f) > int32(JSONB_OBJECT) { @@ -168789,7 +168935,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i /* Because pPasre->oom!=0 */ libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(j), (*(*TJsonParse)(unsafe.Pointer(bp + 80))).FaBlob, uint64((*(*TJsonParse)(unsafe.Pointer(bp + 80))).FnBlob)) k = j + (*(*TJsonParse)(unsafe.Pointer(bp + 80))).FnBlob - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(k), zKey, uint64(nKey)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(k), zKey, uint64(uint64(nKey))) k += nKey libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(k), (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob, uint64((*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob)) if (*TJsonParse)(unsafe.Pointer(pParse)).Fdelta != 0 { @@ -168804,7 +168950,7 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') { x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(iRoot)))) & int32(0x0f)) - if int32(x) != int32(JSONB_ARRAY) { + if int32(int32(x)) != int32(JSONB_ARRAY) { return uint32(JSON_LOOKUP_NOTFOUND) } n = _jsonbPayloadSize(tls, pParse, iRoot, bp) @@ -168991,7 +169137,7 @@ _4: goto returnfromblob_malformed } x = int8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n)))) - if int32(x) == int32('-') { + if int32(int32(x)) == int32('-') { if *(*Tu32)(unsafe.Pointer(bp)) < uint32(2) { goto returnfromblob_malformed } @@ -169035,6 +169181,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -169072,7 +169219,7 @@ _10: break } c = *(*int8)(unsafe.Pointer(z2 + uintptr(iIn))) - if int32(c) == int32('\\') { + if int32(int32(c)) == int32('\\') { szEscape = _jsonUnescapeOneChar(tls, z2+uintptr(iIn), *(*Tu32)(unsafe.Pointer(bp))-iIn, bp+24) if *(*Tu32)(unsafe.Pointer(bp + 24)) <= uint32(0x7f) { v19 = iOut @@ -169129,7 +169276,7 @@ _10: iIn++ } /* end for() */ *(*int8)(unsafe.Pointer(zOut + uintptr(iOut))) = 0 - Xsqlite3_result_text(tls, pCtx, zOut, int32(iOut), __ccgo_fp(_sqlite3OomClear)) + Xsqlite3_result_text(tls, pCtx, zOut, int32(int32(iOut)), __ccgo_fp(_sqlite3OomClear)) goto _15 _13: ; @@ -169153,10 +169300,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24940, -int32(1)) @@ -169219,7 +169368,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_TEXTRAW), uint32(nJson), zJson) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_TEXTRAW), uint32(uint32(nJson)), zJson) } case int32(SQLITE_FLOAT): r = Xsqlite3_value_double(tls, pArg) @@ -169237,7 +169386,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25038) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(uint32(n)), z) } } } @@ -169247,7 +169396,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin if z1 == uintptr(0) { return int32(1) } - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_INT), uint32(n1), z1) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_INT), uint32(uint32(n1)), z1) break } if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -169313,7 +169462,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e v1 = int32(JSON_EDITABLE) } flgs = v1 - p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), uint32(flgs)) + p = _jsonParseFuncArg(tls, ctx, *(*uintptr)(unsafe.Pointer(argv)), uint32(uint32(flgs))) if p == uintptr(0) { return } @@ -169345,7 +169494,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e } rc = uint32(0) } else { - (*TJsonParse)(unsafe.Pointer(p)).FeEdit = uint8(eEdit) + (*TJsonParse)(unsafe.Pointer(p)).FeEdit = uint8(uint8(eEdit)) (*TJsonParse)(unsafe.Pointer(p)).FnIns = (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob (*TJsonParse)(unsafe.Pointer(p)).FaIns = (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob (*TJsonParse)(unsafe.Pointer(p)).Fdelta = 0 @@ -169366,6 +169515,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -169454,6 +169604,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -169465,11 +169616,11 @@ rebuild_from_cache: (*TJsonParse)(unsafe.Pointer(p)).FnJPRef = uint32(1) if pFromCache != uintptr(0) { nBlob = (*TJsonParse)(unsafe.Pointer(pFromCache)).FnBlob - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = _sqlite3DbMallocRaw(tls, db, uint64(nBlob)) + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = _sqlite3DbMallocRaw(tls, db, uint64(uint64(nBlob))) if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { goto json_pfa_oom } - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, (*TJsonParse)(unsafe.Pointer(pFromCache)).FaBlob, uint64(nBlob)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(p)).FaBlob, (*TJsonParse)(unsafe.Pointer(pFromCache)).FaBlob, uint64(uint64(nBlob))) v1 = nBlob (*TJsonParse)(unsafe.Pointer(p)).FnBlob = v1 (*TJsonParse)(unsafe.Pointer(p)).FnBlobAlloc = v1 @@ -169543,6 +169694,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -169553,6 +169705,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24940, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -169819,18 +169972,18 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonStringInit(tls, bp, ctx) if _jsonAllDigits(tls, zPath, nPath) != 0 { _jsonAppendRawNZ(tls, bp, __ccgo_ts+25099, uint32(1)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, uint32(uint32(nPath))) _jsonAppendRawNZ(tls, bp, __ccgo_ts+5165, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { _jsonAppendRawNZ(tls, bp, __ccgo_ts+1665, uint32(1)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, uint32(uint32(nPath))) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, uint32(uint32(nPath))) } else { _jsonAppendRawNZ(tls, bp, __ccgo_ts+25101, uint32(2)) - _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) + _jsonAppendRaw(tls, bp, zPath, uint32(uint32(nPath))) _jsonAppendRawNZ(tls, bp, __ccgo_ts+25104, uint32(1)) } } @@ -169891,6 +170044,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -169970,7 +170124,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt nTValue = uint32(0) /* Header size of the target value */ *(*Tu32)(unsafe.Pointer(bp + 8)) = uint32(0) /* Payload size of the patch value */ x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPatch)))) & int32(0x0f)) - if int32(x) != int32(JSONB_OBJECT) { /* Total size of the target, header+payload */ + if int32(int32(x)) != int32(JSONB_OBJECT) { /* Total size of the target, header+payload */ n = _jsonbPayloadSize(tls, pPatch, iPatch, bp) szPatch = n + *(*Tu32)(unsafe.Pointer(bp)) *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) @@ -169985,11 +170139,11 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt return v1 /* Line 03 */ } x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget)))) & int32(0x0f)) - if int32(x) != int32(JSONB_OBJECT) { /* Algorithm line 05 */ + if int32(int32(x)) != int32(JSONB_OBJECT) { /* Algorithm line 05 */ n = _jsonbPayloadSize(tls, pTarget, iTarget, bp) _jsonBlobEdit(tls, pTarget, iTarget+n, *(*Tu32)(unsafe.Pointer(bp)), uintptr(0), uint32(0)) x = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) - *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) = uint8(int32(x)&int32(0xf0) | int32(JSONB_OBJECT)) + *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTarget))) = uint8(int32(int32(x))&int32(0xf0) | int32(JSONB_OBJECT)) } n = _jsonbPayloadSize(tls, pPatch, iPatch, bp) if n == uint32(0) { @@ -170006,7 +170160,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt for iPCursor < iPEnd { /* Algorithm line 07 */ iPLabel = iPCursor ePLabel = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPCursor)))) & int32(0x0f)) - if int32(ePLabel) < int32(JSONB_TEXT) || int32(ePLabel) > int32(JSONB_TEXTRAW) { + if int32(int32(ePLabel)) < int32(JSONB_TEXT) || int32(int32(ePLabel)) > int32(JSONB_TEXTRAW) { return int32(JSON_MERGE_BADPATCH) } nPLabel = _jsonbPayloadSize(tls, pPatch, iPCursor, bp+12) @@ -170030,7 +170184,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt for iTCursor < iTEnd { /* true if the patch and target labels match */ iTLabel = iTCursor eTLabel = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTCursor)))) & int32(0x0f)) - if int32(eTLabel) < int32(JSONB_TEXT) || int32(eTLabel) > int32(JSONB_TEXTRAW) { + if int32(int32(eTLabel)) < int32(JSONB_TEXT) || int32(int32(eTLabel)) > int32(JSONB_TEXTRAW) { return int32(JSON_MERGE_BADTARGET) } nTLabel = _jsonbPayloadSize(tls, pTarget, iTCursor, bp+4) @@ -170048,7 +170202,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt if iTValue+nTValue+*(*Tu32)(unsafe.Pointer(bp + 8)) > iTEnd { return int32(JSON_MERGE_BADTARGET) } - isEqual = _jsonLabelCompare(tls, (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel+nPLabel), *(*Tu32)(unsafe.Pointer(bp + 12)), libc.BoolInt32(int32(ePLabel) == int32(JSONB_TEXT) || int32(ePLabel) == int32(JSONB_TEXTRAW)), (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTLabel+nTLabel), *(*Tu32)(unsafe.Pointer(bp + 4)), libc.BoolInt32(int32(eTLabel) == int32(JSONB_TEXT) || int32(eTLabel) == int32(JSONB_TEXTRAW))) + isEqual = _jsonLabelCompare(tls, (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel+nPLabel), *(*Tu32)(unsafe.Pointer(bp + 12)), libc.BoolInt32(int32(int32(ePLabel)) == int32(JSONB_TEXT) || int32(int32(ePLabel)) == int32(JSONB_TEXTRAW)), (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTLabel+nTLabel), *(*Tu32)(unsafe.Pointer(bp + 4)), libc.BoolInt32(int32(int32(eTLabel)) == int32(JSONB_TEXT) || int32(int32(eTLabel)) == int32(JSONB_TEXTRAW))) if isEqual != 0 { break } @@ -170057,7 +170211,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue)))) & int32(0x0f)) if iTCursor < iTEnd { /* A match was found. Algorithm line 08 */ - if int32(x) == 0 { + if int32(int32(x)) == 0 { /* Patch value is NULL. Algorithm line 09 */ _jsonBlobEdit(tls, pTarget, iTLabel, nTLabel+*(*Tu32)(unsafe.Pointer(bp + 4))+nTValue+*(*Tu32)(unsafe.Pointer(bp + 8)), uintptr(0), uint32(0)) /* vvvvvv----- No OOM on a delete-only edit */ @@ -170074,7 +170228,7 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt *(*int32)(unsafe.Pointer(pTarget + 52)) += savedDelta } } else { - if int32(x) > 0 { /* Algorithm line 13 */ + if int32(int32(x)) > 0 { /* Algorithm line 13 */ /* No match and patch value is not NULL */ szNew = *(*Tu32)(unsafe.Pointer(bp + 12)) + nPLabel if int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob + uintptr(iPValue))))&int32(0x0f) != int32(JSONB_OBJECT) { /* Line 14 */ @@ -170082,14 +170236,14 @@ func _jsonMergePatch(tls *libc.TLS, pTarget uintptr, iTarget Tu32, pPatch uintpt if (*TJsonParse)(unsafe.Pointer(pTarget)).Foom != 0 { return int32(JSON_MERGE_OOM) } - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTEnd), (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel), uint64(szNew)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTEnd), (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel), uint64(uint64(szNew))) libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTEnd+szNew), (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPValue), uint64(*(*Tu32)(unsafe.Pointer(bp + 16))+nPValue)) } else { _jsonBlobEdit(tls, pTarget, iTEnd, uint32(0), uintptr(0), szNew+uint32(1)) if (*TJsonParse)(unsafe.Pointer(pTarget)).Foom != 0 { return int32(JSON_MERGE_OOM) } - libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTEnd), (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel), uint64(szNew)) + libc.Xmemcpy(tls, (*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob+uintptr(iTEnd), (*TJsonParse)(unsafe.Pointer(pPatch)).FaBlob+uintptr(iPLabel), uint64(uint64(szNew))) *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pTarget)).FaBlob + uintptr(iTEnd+szNew))) = uint8(0x00) savedDelta1 = (*TJsonParse)(unsafe.Pointer(pTarget)).Fdelta (*TJsonParse)(unsafe.Pointer(pTarget)).Fdelta = 0 @@ -170258,9 +170412,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -170370,6 +170526,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -170459,12 +170616,12 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return case int32(SQLITE_BLOB): if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - if int32(flags)&int32(0x04) != 0 { + if int32(int32(flags))&int32(0x04) != 0 { /* Superficial checking only - accomplished by the ** jsonFuncArgMightBeBinary() call above. */ res = uint8(1) } else { - if int32(flags)&int32(0x08) != 0 { + if int32(int32(flags))&int32(0x08) != 0 { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) @@ -170476,7 +170633,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } fallthrough default: - if int32(flags)&int32(0x3) == 0 { + if int32(int32(flags))&int32(0x3) == 0 { break } libc.Xmemset(tls, bp+72, 0, uint64(72)) @@ -170488,7 +170645,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if (*TJsonParse)(unsafe.Pointer(p)).FnErr != 0 { /* no-op */ } else { - if int32(flags)&int32(0x02) != 0 || int32((*TJsonParse)(unsafe.Pointer(p)).FhasNonstd) == 0 { + if int32(int32(flags))&int32(0x02) != 0 || int32((*TJsonParse)(unsafe.Pointer(p)).FhasNonstd) == 0 { res = uint8(1) } } @@ -170499,7 +170656,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } break } - Xsqlite3_result_int(tls, ctx, int32(res)) + Xsqlite3_result_int(tls, ctx, int32(int32(res))) } // C documentation @@ -170679,24 +170836,24 @@ func _jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { z = (*TJsonString)(unsafe.Pointer(pStr)).FzBuf i = uint32(1) for { - if v3 = uint64(i) < (*TJsonString)(unsafe.Pointer(pStr)).FnUsed; v3 { + if v3 = uint64(uint64(i)) < (*TJsonString)(unsafe.Pointer(pStr)).FnUsed; v3 { v2 = *(*int8)(unsafe.Pointer(z + uintptr(i))) c = v2 } if !(v3 && (int32(v2) != int32(',') || inStr != 0 || nNest != 0)) { break } - if int32(c) == int32('"') { + if int32(int32(c)) == int32('"') { inStr = libc.BoolInt32(!(inStr != 0)) } else { - if int32(c) == int32('\\') { + if int32(int32(c)) == int32('\\') { i++ } else { if !(inStr != 0) { - if int32(c) == int32('{') || int32(c) == int32('[') { + if int32(int32(c)) == int32('{') || int32(int32(c)) == int32('[') { nNest++ } - if int32(c) == int32('}') || int32(c) == int32(']') { + if int32(int32(c)) == int32('}') || int32(int32(c)) == int32(']') { nNest-- } } @@ -170707,9 +170864,9 @@ func _jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { ; i++ } - if uint64(i) < (*TJsonString)(unsafe.Pointer(pStr)).FnUsed { - *(*Tu64)(unsafe.Pointer(pStr + 24)) -= uint64(i) - libc.Xmemmove(tls, z+1, z+uintptr(i+uint32(1)), (*TJsonString)(unsafe.Pointer(pStr)).FnUsed-uint64(1)) + if uint64(uint64(i)) < (*TJsonString)(unsafe.Pointer(pStr)).FnUsed { + *(*Tu64)(unsafe.Pointer(pStr + 24)) -= uint64(uint64(i)) + libc.Xmemmove(tls, z+1, z+uintptr(i+uint32(1)), uint64((*TJsonString)(unsafe.Pointer(pStr)).FnUsed)-uint64(1)) *(*int8)(unsafe.Pointer(z + uintptr((*TJsonString)(unsafe.Pointer(pStr)).FnUsed))) = 0 } else { (*TJsonString)(unsafe.Pointer(pStr)).FnUsed = uint64(1) @@ -171079,14 +171236,14 @@ func _jsonEachNext(tls *libc.TLS, cur uintptr) (r int32) { i = uint32(_jsonSkipLabel(tls, p)) x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob + uintptr(i)))) & int32(0x0f)) n = _jsonbPayloadSize(tls, p+192, i, bp) - if int32(x) == int32(JSONB_OBJECT) || int32(x) == int32(JSONB_ARRAY) { + if int32(int32(x)) == int32(JSONB_OBJECT) || int32(int32(x)) == int32(JSONB_ARRAY) { if (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent >= (*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc { nNew = uint64((*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc*uint32(2) + uint32(3)) pNew = _sqlite3DbRealloc(tls, (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb, (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent, uint64(24)*nNew) if pNew == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc = uint32(nNew) + (*TJsonEachCursor)(unsafe.Pointer(p)).FnParentAlloc = uint32(uint32(nNew)) (*TJsonEachCursor)(unsafe.Pointer(p)).FaParent = pNew } levelChange = uint8(1) @@ -171166,7 +171323,7 @@ func _jsonEachPathLength(tls *libc.TLS, p uintptr) (r int32) { } } } - return int32(n) + return int32(int32(n)) } // C documentation @@ -171241,7 +171398,7 @@ func _jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, iColumn int32) (r (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FnUsed = nBase case int32(JEACH_PATH): n1 = uint32(_jsonEachPathLength(tls, p)) - Xsqlite3_result_text64(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, uint64(n1), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) + Xsqlite3_result_text64(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, uint64(uint64(n1)), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) default: Xsqlite3_result_text(tls, ctx, (*TJsonEachCursor)(unsafe.Pointer(p)).Fpath.FzBuf, int32((*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot), libc.UintptrFromInt32(0)) case int32(JEACH_JSON): @@ -171458,6 +171615,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -171755,7 +171913,7 @@ func _sqlite3JsonTableFunctions(tls *libc.TLS, db uintptr) (r int32) { rc = SQLITE_OK i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(32)/libc.Uint64FromInt64(16) && rc == SQLITE_OK) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(32)/libc.Uint64FromInt64(16) && rc == SQLITE_OK) { break } rc = Xsqlite3_create_module(tls, db, _aMod[i].FzName, _aMod[i].FpModule, uintptr(0)) @@ -172225,7 +172383,7 @@ func _readInt64(tls *libc.TLS, p uintptr) (r Ti64) { defer tls.Free(16) var _ /* x at bp+0 */ Tu64 libc.Xmemcpy(tls, bp, p, uint64(8)) - return int64(libc.X__builtin_bswap64(tls, *(*Tu64)(unsafe.Pointer(bp)))) + return int64(libc.X__builtin_bswap64(tls, uint64(*(*Tu64)(unsafe.Pointer(bp))))) } // C documentation @@ -172253,7 +172411,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = int64(libc.X__builtin_bswap64(tls, uint64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = int64(libc.X__builtin_bswap64(tls, uint64(uint64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -172286,7 +172444,7 @@ func _nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { // ** in the Rtree.aHash table. // */ func _nodeHash(tls *libc.TLS, iNode Ti64) (r uint32) { - return uint32(iNode) % uint32(HASHSIZE) + return uint32(uint32(iNode)) % uint32(HASHSIZE) } // C documentation @@ -172359,7 +172517,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+uint64((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+uint64((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+uint64((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -172433,7 +172591,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+uint64((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+uint64((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -172525,7 +172683,7 @@ func _nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) pDst = (*TRtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(int32(4)+int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*iCell) pSrc = pDst + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) nByte = (_readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2) - iCell - int32(1)) * int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) - libc.Xmemmove(tls, pDst, pSrc, uint64(nByte)) + libc.Xmemmove(tls, pDst, pSrc, uint64(uint64(nByte))) _writeInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2, _readInt16(tls, (*TRtreeNode)(unsafe.Pointer(pNode)).FzData+2)-int32(1)) (*TRtreeNode)(unsafe.Pointer(pNode)).FisDirty = int32(1) } @@ -173264,7 +173422,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(uint64(uint64(nNew))*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -173303,13 +173461,13 @@ func _rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLev _, _, _ = ii, pFirst, pNew pFirst = _rtreeSearchPointFirst(tls, pCur) *(*Tu32)(unsafe.Pointer(pCur + 128 + uintptr(iLevel)*4))++ - if pFirst == uintptr(0) || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && int32((*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel) { + if pFirst == uintptr(0) || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore || (*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore && int32((*TRtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(int32(iLevel)) { if (*TRtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 { pNew = _rtreeEnqueue(tls, pCur, rScore, iLevel) if pNew == uintptr(0) { return uintptr(0) } - ii = int32((int64(pNew)-int64((*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint))/24) + int32(1) + ii = int32((int64(int64(pNew))-int64((*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint))/24) + int32(1) if ii < int32(RTREE_CACHE_SZ) { *(*uintptr)(unsafe.Pointer(pCur + 88 + uintptr(ii)*8)) = *(*uintptr)(unsafe.Pointer(pCur + 88)) } else { @@ -173648,7 +173806,7 @@ func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32 if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } - pInfo = Xsqlite3_malloc64(tls, uint64(112)+uint64((*TRtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize)) + pInfo = Xsqlite3_malloc64(tls, uint64(uint64(112)+uint64((*TRtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))) if !(pInfo != 0) { return int32(SQLITE_NOMEM) } @@ -173699,7 +173857,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp iRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) *(*Ti64)(unsafe.Pointer(bp + 24)) = 0 eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) && Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) == float64(iRowid) { + if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) && Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) == float64(float64(iRowid)) { rc = _findLeafNode(tls, pRtree, iRowid, bp+16, bp+24) } else { rc = SQLITE_OK @@ -173722,12 +173880,12 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*uint64(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*uint64(uint64(argc)))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint64(24)*uint64(argc)) + libc.Xmemset(tls, (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, uint64(24)*uint64(uint64(argc))) libc.Xmemset(tls, pCsr+128, 0, uint64(4)*uint64((*TRtree)(unsafe.Pointer(pRtree)).FiDepth+libc.Int32FromInt32(1))) ii = 0 for { @@ -173753,7 +173911,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp } else { if eType1 == int32(SQLITE_INTEGER) { iVal = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8))) - *(*TRtreeDValue)(unsafe.Pointer(p1 + 8)) = float64(iVal) + *(*TRtreeDValue)(unsafe.Pointer(p1 + 8)) = float64(float64(iVal)) if iVal >= libc.Int64FromInt32(1)<> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -174394,7 +174552,7 @@ func _SortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, i aRight = aIdx + uintptr(nLeft)*4 _SortByDimension(tls, pRtree, aLeft, nLeft, iDim, aCell, aSpare) _SortByDimension(tls, pRtree, aRight, nRight, iDim, aCell, aSpare) - libc.Xmemcpy(tls, aSpare, aLeft, uint64(4)*uint64(nLeft)) + libc.Xmemcpy(tls, aSpare, aLeft, uint64(4)*uint64(uint64(nLeft))) aLeft = aSpare for iLeft < nLeft || iRight < nRight { if int32((*TRtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { @@ -174450,13 +174608,13 @@ func _splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int3 iBestDim = 0 iBestSplit = 0 fBestMargin = float64(0) - nByte = int64(uint64(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)+libc.Int32FromInt32(1)) * (uint64(8) + uint64(nCell)*uint64(4))) - aaSorted = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = int64(uint64(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)+libc.Int32FromInt32(1)) * (uint64(8) + uint64(uint64(nCell))*uint64(4))) + aaSorted = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if !(aaSorted != 0) { return int32(SQLITE_NOMEM) } aSpare = aaSorted + uintptr((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*8 + uintptr(int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)*nCell)*4 - libc.Xmemset(tls, aaSorted, 0, uint64(nByte)) + libc.Xmemset(tls, aaSorted, 0, uint64(uint64(nByte))) ii = 0 for { if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim)) { @@ -174621,7 +174779,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*uint64(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*uint64(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -174749,6 +174907,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -174856,7 +175015,7 @@ func _removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) (r ** the Rtree.pDeleted list. Its contents will be re-inserted later on. */ _nodeHashDelete(tls, pRtree, pNode) - (*TRtreeNode)(unsafe.Pointer(pNode)).FiNode = int64(iHeight) + (*TRtreeNode)(unsafe.Pointer(pNode)).FiNode = int64(int64(iHeight)) (*TRtreeNode)(unsafe.Pointer(pNode)).FpNext = (*TRtree)(unsafe.Pointer(pRtree)).FpDeleted (*TRtreeNode)(unsafe.Pointer(pNode)).FnRef++ (*TRtree)(unsafe.Pointer(pRtree)).FpDeleted = pNode @@ -175126,8 +175285,8 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { var f float32 _, _, _ = d, f, v1 d = Xsqlite3_value_double(tls, v) - f = float32(d) - if float64(f) > d { + f = float32(float32(d)) + if float64(float64(f)) > d { if d < libc.Float64FromInt32(0) { v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { @@ -175143,8 +175302,8 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { var f float32 _, _, _ = d, f, v1 d = Xsqlite3_value_double(tls, v) - f = float32(d) - if float64(f) < d { + f = float32(float32(d)) + if float64(float64(f)) < d { if d < libc.Float64FromInt32(0) { v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { @@ -175354,6 +175513,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -175504,7 +175664,7 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { _ = i i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8)) { break } if Xsqlite3_stricmp(tls, zName, _azName1[i]) == 0 { @@ -175613,7 +175773,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { - rc = Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(f), appStmt[i], uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(uint32(f)), appStmt[i], uintptr(0)) } else { rc = int32(SQLITE_NOMEM) } @@ -175653,7 +175813,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - rc = Xsqlite3_prepare_v3(tls, db, zSql1, -int32(1), uint32(f), pRtree+184, uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, db, zSql1, -int32(1), uint32(uint32(f)), pRtree+184, uintptr(0)) Xsqlite3_free(tls, zSql1) } } @@ -175808,20 +175968,20 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+uint64(nDb)+uint64(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+uint64(uint64(nDb))+uint64(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+uint64(nDb)+uint64(nName*int32(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(968)+uint64(uint64(nDb))+uint64(nName*int32(2))+uint64(8)) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 (*TRtree)(unsafe.Pointer(pRtree)).FzName = (*TRtree)(unsafe.Pointer(pRtree)).FzDb + uintptr(nDb+int32(1)) (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName = (*TRtree)(unsafe.Pointer(pRtree)).FzName + uintptr(nName+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = uint8(eCoordType) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) + (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = uint8(uint8(eCoordType)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(uint64(nDb))) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(uint64(nName))) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(uint64(nName))) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27289, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure @@ -175902,6 +176062,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -176175,11 +176336,11 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt if Xsqlite3_step(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) == int32(SQLITE_ROW) { nNode = Xsqlite3_column_bytes(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0) pNode = Xsqlite3_column_blob(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0) - pRet = Xsqlite3_malloc64(tls, uint64(nNode)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nNode))) if pRet == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pRet, pNode, uint64(nNode)) + libc.Xmemcpy(tls, pRet, pNode, uint64(uint64(nNode))) *(*int32)(unsafe.Pointer(pnNode)) = nNode } } @@ -176731,11 +176892,11 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { j = 0 seenDP = 0 seenE = 0 - if int32(c) == int32('-') { + if int32(int32(c)) == int32('-') { j = int32(1) c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j)))) } - if int32(c) == int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) >= int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) <= int32('9') { + if int32(int32(c)) == int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) >= int32('0') && int32(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) <= int32('9') { return 0 } for { @@ -176743,7 +176904,7 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { if int32(_sqlite3CtypeMap[uint8(c)])&int32(0x04) != 0 { goto _1 } - if int32(c) == int32('.') { + if int32(int32(c)) == int32('.') { if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) == int32('-') { return 0 } @@ -176753,7 +176914,7 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { seenDP = int32(1) goto _1 } - if int32(c) == int32('e') || int32(c) == int32('E') { + if int32(int32(c)) == int32('e') || int32(int32(c)) == int32('E') { if int32(*(*uint8)(unsafe.Pointer(z + uintptr(j-int32(1))))) < int32('0') { return 0 } @@ -176764,11 +176925,11 @@ func _geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) (r int32) { seenE = v2 seenDP = v2 c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) - if int32(c) == int32('+') || int32(c) == int32('-') { + if int32(int32(c)) == int32('+') || int32(int32(c)) == int32('-') { j++ c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j+int32(1))))) } - if int32(c) < int32('0') || int32(c) > int32('9') { + if int32(int32(c)) < int32('0') || int32(int32(c)) > int32('9') { return 0 } goto _1 @@ -176820,7 +176981,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(uint64((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -176843,10 +177004,10 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { } c = _geopolySkipSpace(tls, bp) (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ - if int32(c) == int32(',') { + if int32(int32(c)) == int32(',') { continue } - if int32(c) == int32(']') && ii >= int32(2) { + if int32(int32(c)) == int32(']') && ii >= int32(2) { break } (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -176865,7 +177026,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*uint64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -176886,6 +177047,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -176925,8 +177087,8 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( return uintptr(0) } nVertex = int32(*(*uint8)(unsafe.Pointer(a + 1)))< int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+uint64((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+uint64((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -177309,7 +177471,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) + rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(float64(n)) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) goto _1 @@ -177367,19 +177529,19 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, break } r = float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4))) - if r < float64(mnX) { - mnX = float32(r) + if r < float64(float64(mnX)) { + mnX = float32(float32(r)) } else { - if r > float64(mxX) { - mxX = float32(r) + if r > float64(float64(mxX)) { + mxX = float32(float32(r)) } } r = float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4))) - if r < float64(mnY) { - mnY = float32(r) + if r < float64(float64(mnY)) { + mnY = float32(float32(r)) } else { - if r > float64(mxY) { - mxY = float32(r) + if r > float64(float64(mxY)) { + mxY = float32(float32(r)) } } goto _5 @@ -177393,9 +177555,10 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -177496,8 +177659,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -177763,18 +177926,18 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(float64(y1)) - float64(float64(x1))*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx pEvent = (*TGeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnEvent)*32 (*TGeoOverlap)(unsafe.Pointer(p)).FnEvent++ - (*TGeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x0) + (*TGeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(float64(x0)) (*TGeoEvent)(unsafe.Pointer(pEvent)).FeType = 0 (*TGeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg pEvent = (*TGeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnEvent)*32 (*TGeoOverlap)(unsafe.Pointer(p)).FnEvent++ - (*TGeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x1) + (*TGeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(float64(x1)) (*TGeoEvent)(unsafe.Pointer(pEvent)).FeType = int32(1) (*TGeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg } @@ -177995,8 +178158,8 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { rc = 0 needSort = 0 pActive = uintptr(0) - nByte = int64(uint64(32)*uint64(nVertex)*uint64(2) + uint64(48)*uint64(nVertex) + uint64(24)) - p = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = int64(uint64(32)*uint64(uint64(nVertex))*uint64(2) + uint64(48)*uint64(uint64(nVertex)) + uint64(24)) + p = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if p == uintptr(0) { return -int32(1) } @@ -178124,6 +178287,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -178199,11 +178363,11 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint /* Allocate the sqlite3_vtab structure */ nDb = int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+uint64(nDb)+uint64(nName*int64(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(968)+uint64(uint64(nDb))+uint64(nName*int64(2))+uint64(8)) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+uint64(nDb)+uint64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+uint64(uint64(nDb))+uint64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -178212,9 +178376,9 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint (*TRtree)(unsafe.Pointer(pRtree)).FeCoordType = uint8(RTREE_COORD_REAL32) (*TRtree)(unsafe.Pointer(pRtree)).FnDim = uint8(2) (*TRtree)(unsafe.Pointer(pRtree)).FnDim2 = uint8(4) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(uint64(nDb))) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(uint64(nName))) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(uint64(nName))) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27289, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure @@ -178264,6 +178428,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -178412,6 +178577,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -178694,6 +178860,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -178759,7 +178926,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { rc = SQLITE_OK i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(288)/libc.Uint64FromInt64(24) && rc == SQLITE_OK) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(288)/libc.Uint64FromInt64(24) && rc == SQLITE_OK) { break } if _aFunc[i].FbPure != 0 { @@ -178775,7 +178942,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { } i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(24)/libc.Uint64FromInt64(24) && rc == SQLITE_OK) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(24)/libc.Uint64FromInt64(24) && rc == SQLITE_OK) { break } rc = Xsqlite3_create_function(tls, db, _aAgg[i].FzName, int32(1), libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_DETERMINISTIC)|libc.Int32FromInt32(SQLITE_INNOCUOUS), uintptr(0), uintptr(0), _aAgg[i].FxStep, _aAgg[i].FxFinal) @@ -178991,12 +179158,12 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = int64(uint64(64) + uint64(nArg-libc.Int32FromInt32(1))*uint64(8) + uint64(nArg)*uint64(8)) - pBlob = Xsqlite3_malloc64(tls, uint64(nBlob)) + nBlob = int64(uint64(64) + uint64(nArg-libc.Int32FromInt32(1))*uint64(8) + uint64(uint64(nArg))*uint64(8)) + pBlob = Xsqlite3_malloc64(tls, uint64(uint64(nBlob))) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) } else { - (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = uint32(nBlob) + (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = uint32(uint32(nBlob)) (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb = *(*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)) (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = pBlob + 56 + uintptr(nArg)*8 (*TRtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam = nArg @@ -179962,11 +180129,11 @@ func _rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) (r uint32) { if !(v1 >= 0) { break } - v = v< *(*int32)(unsafe.Pointer(bp + 8)) { + if int32(int32(cnt)) > *(*int32)(unsafe.Pointer(bp + 8)) { /* ERROR: insert count exceeds size of delta */ return -int32(1) } - libc.Xmemcpy(tls, zOut, *(*uintptr)(unsafe.Pointer(bp)), uint64(cnt)) + libc.Xmemcpy(tls, zOut, *(*uintptr)(unsafe.Pointer(bp)), uint64(uint64(cnt))) zOut += uintptr(cnt) *(*uintptr)(unsafe.Pointer(bp)) += uintptr(cnt) *(*int32)(unsafe.Pointer(bp + 8)) = int32(uint32(*(*int32)(unsafe.Pointer(bp + 8))) - cnt) @@ -180186,7 +180353,7 @@ func _rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, _zDelta uintptr, /* ERROR: generated size does not match predicted size */ return -int32(1) } - return int32(total) + return int32(int32(total)) default: /* ERROR: unknown delta operator */ return -int32(1) @@ -180642,11 +180809,11 @@ func _rbuMalloc(tls *libc.TLS, p uintptr, nByte Tsqlite3_int64) (r uintptr) { _ = pRet pRet = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pRet == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pRet, 0, uint64(nByte)) + libc.Xmemset(tls, pRet, 0, uint64(uint64(nByte))) } } return pRet @@ -180663,7 +180830,7 @@ func _rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) var azNew uintptr var nByte Tsqlite3_int64 _, _ = azNew, nByte - nByte = int64((libc.Uint64FromInt32(2)*libc.Uint64FromInt64(8) + libc.Uint64FromInt64(4) + libc.Uint64FromInt32(3)*libc.Uint64FromInt64(1)) * uint64(nCol)) + nByte = int64((libc.Uint64FromInt32(2)*libc.Uint64FromInt64(8) + libc.Uint64FromInt64(4) + libc.Uint64FromInt32(3)*libc.Uint64FromInt64(1)) * uint64(uint64(nCol))) azNew = _rbuMalloc(tls, p, nByte) if azNew != 0 { (*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = azNew @@ -180695,7 +180862,7 @@ func _rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) (r uintptr) { if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { if zStr != 0 { nCopy = libc.Xstrlen(tls, zStr) + uint64(1) - zRet = Xsqlite3_malloc64(tls, nCopy) + zRet = Xsqlite3_malloc64(tls, uint64(uint64(nCopy))) if zRet != 0 { libc.Xmemcpy(tls, zRet, zStr, nCopy) } else { @@ -180826,11 +180993,12 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(32)/libc.Uint64FromInt64(8)) { + if !(uint64(uint64(i)) < libc.Uint64FromInt64(32)/libc.Uint64FromInt64(8)) { break } _rbuFinalize(tls, p, (*(*[4]uintptr)(unsafe.Pointer(bp)))[i]) @@ -181015,8 +181183,8 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*8)) = t1 } *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*8)) = _rbuStrndup(tls, zType, p+56) - *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = uint8(iPk) - *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = libc.BoolUint8(uint8(bNotNull) != 0 || iPk != 0) + *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = uint8(uint8(iPk)) + *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = libc.BoolUint8(uint8(uint8(bNotNull)) != 0 || iPk != 0) iOrder++ } } @@ -181265,6 +181433,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -181562,15 +181731,15 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt break } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) - if int32(c) == int32('x') { + if int32(int32(c)) == int32('x') { zList = _rbuMPrintf(tls, p, __ccgo_ts+30035, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) zSep = __ccgo_ts + 14994 } else { - if int32(c) == int32('d') { + if int32(int32(c)) == int32('d') { zList = _rbuMPrintf(tls, p, __ccgo_ts+30074, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) zSep = __ccgo_ts + 14994 } else { - if int32(c) == int32('f') { + if int32(int32(c)) == int32('f') { zList = _rbuMPrintf(tls, p, __ccgo_ts+30104, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) zSep = __ccgo_ts + 14994 } @@ -181609,7 +181778,7 @@ func _rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) (r uintptr) { var zRet uintptr _, _, _, _ = i, nByte, zRet, v2 zRet = uintptr(0) - nByte = int64(2)*int64(nBind) + int64(1) + nByte = int64(2)*int64(int64(nBind)) + int64(1) zRet = _rbuMalloc(tls, p, nByte) if zRet != 0 { i = 0 @@ -181942,13 +182111,13 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt (*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = aIdxCol nIdxAlloc += int32(16) } - if int32(c) == int32('(') { + if int32(int32(c)) == int32('(') { if nParen == 0 { (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol))).FzSpan = zSql + uintptr(i+int32(1)) } nParen++ } else { - if int32(c) == int32(')') { + if int32(int32(c)) == int32(')') { nParen-- if nParen == 0 { nSpan = int32(t__predefined_ptrdiff_t(zSql+uintptr(i)) - int64((*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*16))).FzSpan)) @@ -181959,21 +182128,21 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt break } } else { - if int32(c) == int32(',') && nParen == int32(1) { + if int32(int32(c)) == int32(',') && nParen == int32(1) { nSpan1 = int32(t__predefined_ptrdiff_t(zSql+uintptr(i)) - int64((*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*16))).FzSpan)) v4 = iIdxCol iIdxCol++ (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(v4)*16))).FnSpan = nSpan1 (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*16))).FzSpan = zSql + uintptr(i+int32(1)) } else { - if int32(c) == int32('"') || int32(c) == int32('\'') || int32(c) == int32('`') { + if int32(int32(c)) == int32('"') || int32(int32(c)) == int32('\'') || int32(int32(c)) == int32('`') { i++ for { if !(int32(1) != 0) { break } - if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == int32(c) { - if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) != int32(c) { + if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == int32(int32(c)) { + if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) != int32(int32(c)) { break } i++ @@ -181984,7 +182153,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt i++ } } else { - if int32(c) == int32('[') { + if int32(int32(c)) == int32('[') { i++ for { if !(int32(1) != 0) { @@ -181999,7 +182168,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt i++ } } else { - if int32(c) == int32('-') && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) == int32('-') { + if int32(int32(c)) == int32('-') && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) == int32('-') { i = i + int32(2) for { if !(*(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != int32('\n')) { @@ -182014,7 +182183,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt break } } else { - if int32(c) == int32('/') && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) == int32('*') { + if int32(int32(c)) == int32('/') && int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) == int32('*') { i = i + int32(2) for { if !(*(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 && (int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != int32('*') || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i+int32(1))))) != int32('/'))) { @@ -182763,7 +182932,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(uint64(uint64(nNew))*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -183106,7 +183275,7 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { } c = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) pVal = Xsqlite3_column_value(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) - if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 || int32(c) != int32('.') { + if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 || int32(int32(c)) != int32('.') { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), i+int32(1), pVal) } goto _1 @@ -183618,7 +183787,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr nTarget = v1 nRbu = libc.Xstrlen(tls, zRbu) nByte = uint64(408) + nTarget + uint64(1) + nRbu + uint64(1) - p = Xsqlite3_malloc64(tls, nByte) + p = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if p != 0 { pState = uintptr(0) /* Create the custom VFS. */ @@ -183850,16 +184019,16 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { nErrmsg = libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg) i = uint32(0) for { - if !(uint64(i) < nErrmsg-uint64(8)) { + if !(uint64(uint64(i)) < nErrmsg-uint64(8)) { break } if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31001, uint64(8)) == 0 { nDel = int32(8) - for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= int32('9') { + for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(uint32(nDel)))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(uint32(nDel)))))) <= int32('9') { nDel++ } - libc.Xmemmove(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+uint32(nDel)), nErrmsg+uint64(1)-uint64(i)-uint64(nDel)) - nErrmsg -= uint64(nDel) + libc.Xmemmove(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i+uint32(uint32(nDel))), nErrmsg+uint64(1)-uint64(uint64(i))-uint64(uint64(nDel))) + nErrmsg -= uint64(uint64(nDel)) } goto _1 _1: @@ -183951,7 +184120,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint switch (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage { case int32(RBU_STAGE_OAL): if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep > 0 { - *(*int32)(unsafe.Pointer(pnOne)) = int32(int64(MAX_PROGRESS) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress) / (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep) + *(*int32)(unsafe.Pointer(pnOne)) = int32(int64(int64(MAX_PROGRESS)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress) / (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep) } else { *(*int32)(unsafe.Pointer(pnOne)) = -int32(1) } @@ -183961,7 +184130,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint *(*int32)(unsafe.Pointer(pnTwo)) = 0 case int32(RBU_STAGE_CKPT): *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS - *(*int32)(unsafe.Pointer(pnTwo)) = int32(int64(MAX_PROGRESS) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep) / int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame)) + *(*int32)(unsafe.Pointer(pnTwo)) = int32(int64(int64(MAX_PROGRESS)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep) / int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame)) case int32(RBU_STAGE_DONE): *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS *(*int32)(unsafe.Pointer(pnTwo)) = MAX_PROGRESS @@ -184356,8 +184525,8 @@ func _rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal Tu32) { } func _rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal Tu16) { - *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(int32(iVal) >> int32(8) & int32(0xFF)) - *(*Tu8)(unsafe.Pointer(aBuf + 1)) = uint8(int32(iVal) >> 0 & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf)) = uint8(int32(int32(iVal)) >> int32(8) & int32(0xFF)) + *(*Tu8)(unsafe.Pointer(aBuf + 1)) = uint8(int32(int32(iVal)) >> 0 & int32(0xFF)) } // C documentation @@ -184377,7 +184546,7 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T } else { if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_OAL) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_WAL) != 0 && iOfst >= (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz { rc = SQLITE_OK - libc.Xmemset(tls, zBuf, 0, uint64(iAmt)) + libc.Xmemset(tls, zBuf, 0, uint64(uint64(iAmt))) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target @@ -184436,10 +184605,10 @@ func _rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst } else { if pRbu != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == int32(RBU_STAGE_OAL) && (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_WAL) != 0 && iOfst >= (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = int64(iAmt) + iOfst + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = int64(int64(iAmt)) + iOfst } else { if (*Trbu_file)(unsafe.Pointer(p)).FopenFlags&int32(SQLITE_OPEN_DELETEONCLOSE) != 0 { - szNew = int64(iAmt) + iOfst + szNew = int64(int64(iAmt)) + iOfst if szNew > (*Trbu_file)(unsafe.Pointer(p)).Fsz { rc = _rbuUpdateTempSize(tls, p, szNew) if rc != SQLITE_OK { @@ -184708,7 +184877,7 @@ func _rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, ** instead of a file on disk. */ if eStage == int32(RBU_STAGE_OAL) { nByte = int64(uint64(iRegion+libc.Int32FromInt32(1)) * uint64(8)) - apNew = Xsqlite3_realloc64(tls, (*Trbu_file)(unsafe.Pointer(p)).FapShm, uint64(nByte)) + apNew = Xsqlite3_realloc64(tls, (*Trbu_file)(unsafe.Pointer(p)).FapShm, uint64(uint64(nByte))) /* This is an RBU connection that uses its own heap memory for the ** pages of the *-shm file. Since no other process can have run ** recovery, the connection must request *-shm pages in order @@ -184721,11 +184890,11 @@ func _rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, (*Trbu_file)(unsafe.Pointer(p)).FnShm = iRegion + int32(1) } if rc == SQLITE_OK { - pNew = Xsqlite3_malloc64(tls, uint64(szRegion)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(szRegion))) if pNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pNew, 0, uint64(szRegion)) + libc.Xmemset(tls, pNew, 0, uint64(uint64(szRegion))) *(*uintptr)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*8)) = pNew } } @@ -185098,7 +185267,7 @@ func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) (r in rc = SQLITE_OK nName = libc.Xstrlen(tls, zName) nByte = uint64(208) + nName + uint64(1) - pNew = Xsqlite3_malloc64(tls, nByte) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { /* Parent VFS */ @@ -185611,7 +185780,7 @@ func _statClose(tls *libc.TLS, pCursor uintptr) (r int32) { func _getLocalPayload(tls *libc.TLS, nUsable int32, flags Tu8, nTotal int32) (r int32) { var nLocal, nMaxLocal, nMinLocal int32 _, _, _ = nLocal, nMaxLocal, nMinLocal - if int32(flags) == int32(0x0D) { /* Table leaf node */ + if int32(int32(flags)) == int32(0x0D) { /* Table leaf node */ nMinLocal = (nUsable-int32(12))*int32(32)/int32(255) - int32(23) nMaxLocal = nUsable - int32(35) } else { /* Index interior and leaf nodes */ @@ -185691,7 +185860,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { _sqlite3BtreeEnter(tls, pBt) nUsable = szPage - _sqlite3BtreeGetReserveNoMutex(tls, pBt) _sqlite3BtreeLeave(tls, pBt) - (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32)) + (*TStatPage)(unsafe.Pointer(p)).FaCell = Xsqlite3_malloc64(tls, uint64(uint64((*TStatPage)(unsafe.Pointer(p)).FnCell+libc.Int32FromInt32(1))*uint64(32))) if (*TStatPage)(unsafe.Pointer(p)).FaCell == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -185731,14 +185900,14 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { goto statPageIsCorrupt } (*TStatCell)(unsafe.Pointer(pCell)).FnLocal = nLocal - if *(*Tu32)(unsafe.Pointer(bp)) > uint32(nLocal) { - nOvfl = int32((*(*Tu32)(unsafe.Pointer(bp)) - uint32(nLocal) + uint32(nUsable) - uint32(4) - uint32(1)) / uint32(nUsable-libc.Int32FromInt32(4))) + if *(*Tu32)(unsafe.Pointer(bp)) > uint32(uint32(nLocal)) { + nOvfl = int32((*(*Tu32)(unsafe.Pointer(bp)) - uint32(uint32(nLocal)) + uint32(uint32(nUsable)) - uint32(4) - uint32(1)) / uint32(nUsable-libc.Int32FromInt32(4))) if iOff+nLocal+int32(4) > nUsable || *(*Tu32)(unsafe.Pointer(bp)) > uint32(0x7fffffff) { goto statPageIsCorrupt } - (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = int32(*(*Tu32)(unsafe.Pointer(bp)) - uint32(nLocal) - uint32((nOvfl-int32(1))*(nUsable-int32(4)))) + (*TStatCell)(unsafe.Pointer(pCell)).FnLastOvfl = int32(*(*Tu32)(unsafe.Pointer(bp)) - uint32(uint32(nLocal)) - uint32((nOvfl-int32(1))*(nUsable-int32(4)))) (*TStatCell)(unsafe.Pointer(pCell)).FnOvfl = nOvfl - (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(4)*uint64(nOvfl)) + (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl = Xsqlite3_malloc64(tls, uint64(uint64(4)*uint64(uint64(nOvfl)))) if (*TStatCell)(unsafe.Pointer(pCell)).FaOvfl == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -185770,6 +185939,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -185833,7 +186003,7 @@ func _statGetPage(tls *libc.TLS, pBt uintptr, iPg Tu32, pPg uintptr) (r int32) { rc = _sqlite3PagerGet(tls, _sqlite3BtreePager(tls, pBt), iPg, bp, 0) if rc == SQLITE_OK { a = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) - libc.Xmemcpy(tls, (*TStatPage)(unsafe.Pointer(pPg)).FaPg, a, uint64(pgsz)) + libc.Xmemcpy(tls, (*TStatPage)(unsafe.Pointer(pPg)).FaPg, a, uint64(uint64(pgsz))) _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -185860,6 +186030,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -186013,7 +186184,7 @@ statNextRestart: ; i++ } - *(*Ti64)(unsafe.Pointer(pCsr + 2128)) += int64(nPayload) + *(*Ti64)(unsafe.Pointer(pCsr + 2128)) += int64(int64(nPayload)) /* If computing aggregate space usage by btree, continue with the ** next page. The loop will exit via the return at label-statNext-done */ @@ -186624,7 +186795,7 @@ func _sessionVarintPut(tls *libc.TLS, aBuf uintptr, iVal int32) (r int32) { // ** Return the number of bytes required to store value iVal as a varint. // */ func _sessionVarintLen(tls *libc.TLS, iVal int32) (r int32) { - return _sqlite3VarintLen(tls, uint64(iVal)) + return _sqlite3VarintLen(tls, uint64(uint64(iVal))) } // C documentation @@ -186659,8 +186830,8 @@ func _sessionGetI64(tls *libc.TLS, aRec uintptr) (r Tsqlite3_int64) { _, _ = x, y x = uint64(uint32(*(*Tu8)(unsafe.Pointer(aRec)))< 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nVarint+int32(1)), z, uint64(n)) + libc.Xmemcpy(tls, aBuf+uintptr(nVarint+int32(1)), z, uint64(uint64(n))) } } nByte = int32(1) + nVarint + n @@ -186750,7 +186921,7 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite } } if pnWrite != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(pnWrite)) += int64(nByte) + *(*Tsqlite3_int64)(unsafe.Pointer(pnWrite)) += int64(int64(nByte)) } return SQLITE_OK } @@ -186765,7 +186936,7 @@ func _sessionSerializeValue(tls *libc.TLS, aBuf uintptr, pValue uintptr, pnWrite func _sessionMalloc64(tls *libc.TLS, pSession uintptr, nByte Ti64) (r uintptr) { var pRet, p1 uintptr _, _ = pRet, p1 - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pSession != 0 { p1 = pSession + 56 *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + Xsqlite3_msize(tls, pRet)) @@ -187007,7 +187178,7 @@ func _sessionChangeHash(tls *libc.TLS, pTab uintptr, bPkOnly int32, aRecord uint ; i++ } - return h % uint32(nBucket) + return h % uint32(uint32(nBucket)) } // C documentation @@ -187032,7 +187203,7 @@ func _sessionChangeEqual(tls *libc.TLS, pTab uintptr, bLeftPkOnly int32, aLeft u if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(iCol))) != 0 { n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) - if n1 != n2 || libc.Xmemcmp(tls, a1, a2, uint64(n1)) != 0 { + if n1 != n2 || libc.Xmemcmp(tls, a1, a2, uint64(uint64(n1))) != 0 { return 0 } a1 += uintptr(n1) @@ -187083,10 +187254,10 @@ func _sessionMergeRecord(tls *libc.TLS, paOut uintptr, nCol int32, aLeft uintptr n1 = _sessionSerialLen(tls, a1) n2 = _sessionSerialLen(tls, a2) if *(*Tu8)(unsafe.Pointer(a2)) != 0 { - libc.Xmemcpy(tls, aOut, a2, uint64(n2)) + libc.Xmemcpy(tls, aOut, a2, uint64(uint64(n2))) aOut += uintptr(n2) } else { - libc.Xmemcpy(tls, aOut, a1, uint64(n1)) + libc.Xmemcpy(tls, aOut, a1, uint64(uint64(n1))) aOut += uintptr(n1) } a1 += uintptr(n1) @@ -187343,14 +187514,14 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin v1 = int32(128) } nNew = int64(2) * int64(v1) - apNew = _sessionMalloc64(tls, pSession, int64(uint64(8)*uint64(nNew))) + apNew = _sessionMalloc64(tls, pSession, int64(uint64(8)*uint64(uint64(nNew)))) if apNew == uintptr(0) { if (*TSessionTable)(unsafe.Pointer(pTab)).FnChange == 0 { return int32(SQLITE_ERROR) } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*uint64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*uint64(uint64(nNew)))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -187362,7 +187533,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin break } bPkOnly = libc.BoolInt32(int32((*TSessionChange)(unsafe.Pointer(p)).Fop) == int32(SQLITE_DELETE) && bPatchset != 0) - iHash = int32(_sessionChangeHash(tls, pTab, bPkOnly, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, int32(nNew))) + iHash = int32(_sessionChangeHash(tls, pTab, bPkOnly, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, int32(int32(nNew)))) pNext = (*TSessionChange)(unsafe.Pointer(p)).FpNext (*TSessionChange)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8)) = p @@ -187377,7 +187548,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin i++ } _sessionFree(tls, pSession, (*TSessionTable)(unsafe.Pointer(pTab)).FapChange) - (*TSessionTable)(unsafe.Pointer(pTab)).FnChange = int32(nNew) + (*TSessionTable)(unsafe.Pointer(pTab)).FnChange = int32(int32(nNew)) (*TSessionTable)(unsafe.Pointer(pTab)).FapChange = apNew } return SQLITE_OK @@ -187473,15 +187644,15 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29644)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29644))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + uint64(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(uint64(uint64(nDbCol))*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pAlloc, 0, uint64(nByte)) + libc.Xmemset(tls, pAlloc, 0, uint64(uint64(nByte))) } } if rc == SQLITE_OK { @@ -187595,7 +187766,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (uint64(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(uint64(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -187711,8 +187882,8 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui nIncr = int32(1) + _sessionVarintLen(tls, n) + n break } - nByte = int32(uint64(nIncr) + (uint64(32) + uint64((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord))) - pNew = _sessionMalloc64(tls, pSession, int64(nByte)) + nByte = int32(uint64(uint64(nIncr)) + (uint64(32) + uint64((*TSessionChange)(unsafe.Pointer(pOld)).FnRecord))) + pNew = _sessionMalloc64(tls, pSession, int64(int64(nByte))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) return @@ -187723,7 +187894,7 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui v2 = pNew + 8 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ - *(*Tu8)(unsafe.Pointer((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord + uintptr(v1))) = uint8(eType) + *(*Tu8)(unsafe.Pointer((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord + uintptr(v1))) = uint8(uint8(eType)) switch eType { case int32(SQLITE_INTEGER): iVal = Xsqlite3_column_int64(tls, pDflt, iField) @@ -187739,13 +187910,13 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui n1 = Xsqlite3_column_bytes(tls, pDflt, iField) z = Xsqlite3_column_text(tls, pDflt, iField) *(*int32)(unsafe.Pointer(pNew + 8)) += _sessionVarintPut(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), n1) - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z, uint64(n1)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z, uint64(uint64(n1))) *(*int32)(unsafe.Pointer(pNew + 8)) += n1 case int32(SQLITE_BLOB): n2 = Xsqlite3_column_bytes(tls, pDflt, iField) z1 = Xsqlite3_column_blob(tls, pDflt, iField) *(*int32)(unsafe.Pointer(pNew + 8)) += _sessionVarintPut(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), n2) - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z1, uint64(n2)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord+uintptr((*TSessionChange)(unsafe.Pointer(pNew)).FnRecord), z1, uint64(uint64(n2))) *(*int32)(unsafe.Pointer(pNew + 8)) += n2 default: break @@ -187757,7 +187928,7 @@ func _sessionUpdateOneChange(tls *libc.TLS, pSession uintptr, pRc uintptr, pp ui (*TSessionChange)(unsafe.Pointer(pNew)).FnRecordField++ *(*int32)(unsafe.Pointer(pNew + 4)) += nIncr if pSession != 0 { - *(*Ti64)(unsafe.Pointer(pSession + 64)) += int64(nIncr) + *(*Ti64)(unsafe.Pointer(pSession + 64)) += int64(int64(nIncr)) } } } @@ -187800,12 +187971,12 @@ func _sessionBufferGrow(tls *libc.TLS, p uintptr, nByte Ti64, pRc uintptr) (r in return int32(1) } } - aNew = Xsqlite3_realloc64(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf, uint64(nNew)) + aNew = Xsqlite3_realloc64(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf, uint64(uint64(nNew))) if uintptr(0) == aNew { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } else { (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf = aNew - (*TSessionBuffer)(unsafe.Pointer(p)).FnAlloc = int32(nNew) + (*TSessionBuffer)(unsafe.Pointer(p)).FnAlloc = int32(int32(nNew)) } } return libc.BoolInt32(*(*int32)(unsafe.Pointer(pRc)) != SQLITE_OK) @@ -187826,7 +187997,7 @@ func _sessionAppendStr(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { _ = nStr nStr = _sqlite3Strlen30(tls, zStr) if 0 == _sessionBufferGrow(tls, p, int64(nStr+int32(1)), pRc) { - libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, uint64(nStr)) + libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), zStr, uint64(uint64(nStr))) *(*int32)(unsafe.Pointer(p + 8)) += nStr *(*Tu8)(unsafe.Pointer((*TSessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf))) = uint8(0x00) } @@ -188141,7 +188312,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp if *(*Ti64)(unsafe.Pointer(bp)) > int64((*TSessionChange)(unsafe.Pointer(pC)).FnMaxSize) { nIncr = int32(*(*Ti64)(unsafe.Pointer(bp)) - int64((*TSessionChange)(unsafe.Pointer(pC)).FnMaxSize)) (*TSessionChange)(unsafe.Pointer(pC)).FnMaxSize = int32(*(*Ti64)(unsafe.Pointer(bp))) - *(*Ti64)(unsafe.Pointer(pSession + 64)) += int64(nIncr) + *(*Ti64)(unsafe.Pointer(pSession + 64)) += int64(int64(nIncr)) } return SQLITE_OK } @@ -188313,7 +188484,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } (*TSessionChange)(unsafe.Pointer(pC)).FnRecordField = uint16((*TSessionTable)(unsafe.Pointer(pTab)).FnCol) (*TSessionChange)(unsafe.Pointer(pC)).FnRecord = int32(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 56))) - (*TSessionChange)(unsafe.Pointer(pC)).Fop = uint8(op) + (*TSessionChange)(unsafe.Pointer(pC)).Fop = uint8(uint8(op)) (*TSessionChange)(unsafe.Pointer(pC)).FpNext = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp)))*8)) *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FapChange + uintptr(*(*int32)(unsafe.Pointer(bp)))*8)) = pC } else { @@ -188330,6 +188501,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -188818,6 +188990,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -188839,7 +189012,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+uint64(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+uint64(uint64(nDb))+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -188999,8 +189172,8 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) (r i } if !(pTab != 0) { /* Allocate new SessionTable object. */ - nByte = int32(uint64(80) + uint64(nName) + uint64(1)) - pTab = _sessionMalloc64(tls, pSession, int64(nByte)) + nByte = int32(uint64(80) + uint64(uint64(nName)) + uint64(1)) + pTab = _sessionMalloc64(tls, pSession, int64(int64(nByte))) if !(pTab != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -189103,8 +189276,8 @@ func _sessionAppendVarint(tls *libc.TLS, p uintptr, v int32, pRc uintptr) { // ** returning. // */ func _sessionAppendBlob(tls *libc.TLS, p uintptr, aBlob uintptr, nBlob int32, pRc uintptr) { - if nBlob > 0 && 0 == _sessionBufferGrow(tls, p, int64(nBlob), pRc) { - libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, uint64(nBlob)) + if nBlob > 0 && 0 == _sessionBufferGrow(tls, p, int64(int64(nBlob)), pRc) { + libc.Xmemcpy(tls, (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf), aBlob, uint64(uint64(nBlob))) *(*int32)(unsafe.Pointer(p + 8)) += nBlob } } @@ -189143,7 +189316,7 @@ func _sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { var zIn, zOut, v1, v2, v3, v4, v5 uintptr _, _, _, _, _, _, _, _ = nStr, zIn, zOut, v1, v2, v3, v4, v5 nStr = _sqlite3Strlen30(tls, zStr)*int32(2) + int32(2) + int32(2) - if 0 == _sessionBufferGrow(tls, p, int64(nStr), pRc) { + if 0 == _sessionBufferGrow(tls, p, int64(int64(nStr)), pRc) { zOut = (*TSessionBuffer)(unsafe.Pointer(p)).FaBuf + uintptr((*TSessionBuffer)(unsafe.Pointer(p)).FnBuf) zIn = zStr v1 = zOut @@ -189188,7 +189361,7 @@ func _sessionAppendCol(tls *libc.TLS, p uintptr, pStmt uintptr, iCol int32, pRc _, _, _ = eType, nByte, z if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { eType = Xsqlite3_column_type(tls, pStmt, iCol) - _sessionAppendByte(tls, p, uint8(eType), pRc) + _sessionAppendByte(tls, p, uint8(uint8(eType)), pRc) if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if eType == int32(SQLITE_INTEGER) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = Xsqlite3_column_int64(tls, pStmt, iCol) @@ -189377,7 +189550,7 @@ func _sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintpt break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - _sessionAppendBlob(tls, pBuf, pStart, int32(int64(a)-int64(pStart)), bp) + _sessionAppendBlob(tls, pBuf, pStart, int32(int64(int64(a))-int64(int64(pStart))), bp) } goto _1 _1: @@ -189963,7 +190136,7 @@ func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), uint64(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), uint64(uint64(nMove))) } (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 @@ -190061,11 +190234,11 @@ func _sessionValueSetStr(tls *libc.TLS, pVal uintptr, aData uintptr, nData int32 ** argument to sqlite3ValueSetStr() and have the copy created ** automatically. But doing so makes it difficult to detect any OOM ** error. Hence the code to create the copy externally. */ - aCopy = Xsqlite3_malloc64(tls, uint64(int64(nData)+int64(1))) + aCopy = Xsqlite3_malloc64(tls, uint64(int64(int64(nData))+int64(1))) if aCopy == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, aCopy, aData, uint64(nData)) + libc.Xmemcpy(tls, aCopy, aData, uint64(uint64(nData))) _sqlite3ValueSetStr(tls, pVal, nData, aCopy, enc, __ccgo_fp(Xsqlite3_free)) return SQLITE_OK } @@ -190320,7 +190493,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext += nVarint nByte = int32(uint64((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*uint64(8)*uint64(2) + uint64(*(*int32)(unsafe.Pointer(bp + 4)))) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 - _sessionBufferGrow(tls, p+72, int64(nByte), bp) + _sessionBufferGrow(tls, p+72, int64(int64(nByte)), bp) } else { *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(226866)) } @@ -190403,11 +190576,11 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ op = *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v2))) - for int32(op) == int32('T') || int32(op) == int32('P') { + for int32(int32(op)) == int32('T') || int32(int32(op)) == int32('P') { if pbNew != 0 { *(*int32)(unsafe.Pointer(pbNew)) = int32(1) } - (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.BoolInt32(int32(op) == int32('P')) + (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset = libc.BoolInt32(int32(int32(op)) == int32('P')) if _sessionChangesetReadTblhdr(tls, p) != 0 { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } @@ -190432,7 +190605,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } - (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = int32(op) + (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop = int32(int32(op)) v9 = p + 8 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ @@ -190443,10 +190616,10 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin return v10 } if paRec != 0 { /* Number of values to buffer */ - if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && int32(op) == int32(SQLITE_UPDATE) { + if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset == 0 && int32(int32(op)) == int32(SQLITE_UPDATE) { nVal = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol * int32(2) } else { - if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && int32(op) == int32(SQLITE_DELETE) { + if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && int32(int32(op)) == int32(SQLITE_DELETE) { nVal = 0 i = 0 for { @@ -190814,7 +190987,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu break } eType = *(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext))) - switch int32(eType) { + switch int32(int32(eType)) { case int32('T'): (*TSessionInput)(unsafe.Pointer(pInput)).FiNext++ v2 = _sessionChangesetBufferTblhdr(tls, pInput, bp+48) @@ -190838,7 +191011,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu fallthrough case int32(SQLITE_DELETE): bIndirect = int32(*(*Tu8)(unsafe.Pointer((*TSessionInput)(unsafe.Pointer(pInput)).FaData + uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext+int32(1))))) - if int32(eType) == int32(SQLITE_DELETE) { + if int32(int32(eType)) == int32(SQLITE_DELETE) { v3 = int32(SQLITE_INSERT) } else { v3 = int32(SQLITE_DELETE) @@ -190846,8 +191019,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu eType2 = v3 *(*int32)(unsafe.Pointer(pInput + 8)) += int32(2) *(*int32)(unsafe.Pointer(bp)) = _sessionChangesetBufferRecord(tls, pInput, *(*int32)(unsafe.Pointer(bp + 24)), bp+52) - _sessionAppendByte(tls, bp+8, uint8(eType2), bp) - _sessionAppendByte(tls, bp+8, uint8(bIndirect), bp) + _sessionAppendByte(tls, bp+8, uint8(uint8(eType2)), bp) + _sessionAppendByte(tls, bp+8, uint8(uint8(bIndirect)), bp) _sessionAppendBlob(tls, bp+8, (*TSessionInput)(unsafe.Pointer(pInput)).FaData+uintptr((*TSessionInput)(unsafe.Pointer(pInput)).FiNext), *(*int32)(unsafe.Pointer(bp + 52)), bp) *(*int32)(unsafe.Pointer(pInput + 8)) += *(*int32)(unsafe.Pointer(bp + 52)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -190855,7 +191028,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*uint64(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*uint64(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -190947,6 +191120,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -191076,13 +191250,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 nCol = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol nU32 = ((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol + int32(33)) / int32(32) if (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) { - (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, int32(uint64(nU32)*uint64(4))) + (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask = Xsqlite3_malloc(tls, int32(uint64(uint64(nU32))*uint64(4))) if (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - libc.Xmemset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, uint64(nU32)*uint64(4)) + libc.Xmemset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, 0, uint64(uint64(nU32))*uint64(4)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_CORRUPT) ii = 0 for { @@ -191108,7 +191282,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 pp = p + 64 for int32(1) != 0 { nUp++ - if 0 == libc.Xmemcmp(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*TSessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, uint64(nU32)*uint64(4)) { + if 0 == libc.Xmemcmp(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, (*TSessionUpdate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FaMask, uint64(uint64(nU32))*uint64(4)) { pUp = *(*uintptr)(unsafe.Pointer(pp)) *(*uintptr)(unsafe.Pointer(pp)) = (*TSessionUpdate)(unsafe.Pointer(pUp)).FpNext (*TSessionUpdate)(unsafe.Pointer(pUp)).FpNext = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpUp @@ -191128,7 +191302,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } } if pUp == uintptr(0) { - nByte = int32(uint64(24) * uint64(nU32) * uint64(4)) + nByte = int32(uint64(24) * uint64(uint64(nU32)) * uint64(4)) bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11586) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { @@ -191137,7 +191311,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 zSep = __ccgo_ts + 1652 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 - libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint64(nU32)*uint64(4)) + libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint64(uint64(nU32))*uint64(4)) _sessionAppendStr(tls, bp+8, __ccgo_ts+33939, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) _sessionAppendStr(tls, bp+8, __ccgo_ts+33952, bp) @@ -191941,7 +192115,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FzTab = zTab (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnCol = (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FabPK = (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK - _sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+72, int64(nByte), bp) + _sessionBufferGrow(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+72, int64(int64(nByte)), bp) (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue = (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Ftblhdr.FaBuf if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) @@ -192257,17 +192431,17 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+uint64(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+uint64(uint64(nRec)))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } libc.Xmemset(tls, pNew, 0, uint64(32)) - (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(op2) - (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = uint8(bIndirect) + (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(uint8(op2)) + (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = uint8(uint8(bIndirect)) (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord = pNew + 1*32 if bIndirect == 0 || bRebase == 0 { (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = nRec - libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, uint64(nRec)) + libc.Xmemcpy(tls, (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord, aRec, uint64(uint64(nRec))) } else { pIn = aRec pOut = (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord @@ -192287,7 +192461,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pOut++ *(*Tu8)(unsafe.Pointer(v3)) = uint8(0xFF) } else { - libc.Xmemcpy(tls, pOut, pIn, uint64(nIn)) + libc.Xmemcpy(tls, pOut, pIn, uint64(uint64(nIn))) pOut += uintptr(nIn) } } @@ -192297,7 +192471,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i ; i++ } - (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = int32(int64(pOut) - int64((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord)) + (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = int32(int64(int64(pOut)) - int64((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord)) } } else { if bRebase != 0 { @@ -192305,15 +192479,15 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i *(*uintptr)(unsafe.Pointer(ppNew)) = pExist } else { nByte = int64(uint64(nRec+(*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint64(32)) - pNew = Xsqlite3_malloc64(tls, uint64(nByte)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pNew == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { a1 = (*TSessionChange)(unsafe.Pointer(pExist)).FaRecord a2 = aRec - libc.Xmemset(tls, pNew, 0, uint64(nByte)) + libc.Xmemset(tls, pNew, 0, uint64(uint64(nByte))) (*TSessionChange)(unsafe.Pointer(pNew)).FbIndirect = libc.BoolUint8(bIndirect != 0 || (*TSessionChange)(unsafe.Pointer(pExist)).FbIndirect != 0) - (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(op2) + (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(uint8(op2)) v4 = pNew + 1*32 (*TSessionChange)(unsafe.Pointer(pNew)).FaRecord = v4 pOut1 = v4 @@ -192330,10 +192504,10 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i *(*Tu8)(unsafe.Pointer(v6)) = uint8(0xFF) } else { if int32(*(*Tu8)(unsafe.Pointer(a2))) == 0 { - libc.Xmemcpy(tls, pOut1, a1, uint64(n1)) + libc.Xmemcpy(tls, pOut1, a1, uint64(uint64(n1))) pOut1 += uintptr(n1) } else { - libc.Xmemcpy(tls, pOut1, a2, uint64(n2)) + libc.Xmemcpy(tls, pOut1, a2, uint64(uint64(n2))) pOut1 += uintptr(n2) } } @@ -192344,7 +192518,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i ; i1++ } - (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = int32(int64(pOut1) - int64((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord)) + (*TSessionChange)(unsafe.Pointer(pNew)).FnRecord = int32(int64(int64(pOut1)) - int64((*TSessionChange)(unsafe.Pointer(pNew)).FaRecord)) } Xsqlite3_free(tls, pExist) } @@ -192373,8 +192547,8 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i /* Allocate a new SessionChange object. Ensure that the aRecord[] ** buffer of the new object is large enough to hold any record that ** may be generated by combining the input records. */ - nByte1 = int64(uint64(32) + uint64((*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint64(nRec)) - pNew = Xsqlite3_malloc64(tls, uint64(nByte1)) + nByte1 = int64(uint64(32) + uint64((*TSessionChange)(unsafe.Pointer(pExist)).FnRecord) + uint64(uint64(nRec))) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(nByte1))) if !(pNew != 0) { Xsqlite3_free(tls, pExist) return int32(SQLITE_NOMEM) @@ -192395,7 +192569,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i if op1 == int32(SQLITE_DELETE) { /* DELETE + INSERT */ (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(SQLITE_UPDATE) if bPatchset != 0 { - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint64(nRec)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint64(uint64(nRec))) *(*uintptr)(unsafe.Pointer(bp)) += uintptr(nRec) } else { if 0 == _sessionMergeUpdate(tls, bp, pTab, bPatchset, aExist, uintptr(0), aRec, uintptr(0)) { @@ -192419,7 +192593,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i } else { /* UPDATE + DELETE */ (*TSessionChange)(unsafe.Pointer(pNew)).Fop = uint8(SQLITE_DELETE) if bPatchset != 0 { - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint64(nRec)) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp)), aRec, uint64(uint64(nRec))) *(*uintptr)(unsafe.Pointer(bp)) += uintptr(nRec) } else { _sessionMergeRecord(tls, bp, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol, aRec, aExist) @@ -192463,7 +192637,7 @@ func _sessionChangesetCheckCompat(tls *libc.TLS, pTab uintptr, nCol int32, abPK v2 = 0 } bPK = uint8(v2) - if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != int32(bPK) { + if int32(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != int32(int32(bPK)) { return 0 } goto _1 @@ -192473,7 +192647,7 @@ func _sessionChangesetCheckCompat(tls *libc.TLS, pTab uintptr, nCol int32, abPK } return int32(1) } - return libc.BoolInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnCol == nCol && 0 == libc.Xmemcmp(tls, abPK, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, uint64(nCol))) + return libc.BoolInt32((*TSessionTable)(unsafe.Pointer(pTab)).FnCol == nCol && 0 == libc.Xmemcmp(tls, abPK, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, uint64(uint64(nCol)))) } func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nCol int32, op int32, aRec uintptr, nRec int32, pOut uintptr) (r int32) { @@ -192500,7 +192674,7 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC break } eType = Xsqlite3_column_type(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FpDfltStmt, ii) - _sessionAppendByte(tls, pOut, uint8(eType), bp) + _sessionAppendByte(tls, pOut, uint8(uint8(eType)), bp) switch eType { case int32(SQLITE_FLOAT): fallthrough @@ -192639,7 +192813,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(80)+uint64(*(*int32)(unsafe.Pointer(bp + 40)))+uint64(nNew)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(80)+uint64(*(*int32)(unsafe.Pointer(bp + 40)))+uint64(uint64(nNew))+uint64(1))) if !(pTab != 0) { rc = int32(SQLITE_NOMEM) break @@ -193026,10 +193200,10 @@ func _sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintp nn1 = _sessionSerialLen(tls, a1) nn2 = _sessionSerialLen(tls, a2) if int32(*(*Tu8)(unsafe.Pointer(a1))) == 0 || int32(*(*Tu8)(unsafe.Pointer(a1))) == int32(0xFF) { - libc.Xmemcpy(tls, pOut, a2, uint64(nn2)) + libc.Xmemcpy(tls, pOut, a2, uint64(uint64(nn2))) pOut += uintptr(nn2) } else { - libc.Xmemcpy(tls, pOut, a1, uint64(nn1)) + libc.Xmemcpy(tls, pOut, a1, uint64(uint64(nn1))) pOut += uintptr(nn1) } a1 += uintptr(nn1) @@ -193039,7 +193213,7 @@ func _sessionAppendRecordMerge(tls *libc.TLS, pBuf uintptr, nCol int32, a1 uintp ; i++ } - (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32(int64(pOut) - int64((*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) + (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32(int64(int64(pOut)) - int64((*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) } } @@ -193091,12 +193265,12 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe if !(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0) && *(*Tu8)(unsafe.Pointer(a1)) != 0 { bData = int32(1) } - libc.Xmemcpy(tls, pOut, a1, uint64(n1)) + libc.Xmemcpy(tls, pOut, a1, uint64(uint64(n1))) pOut += uintptr(n1) } else { if int32(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) && *(*Tu8)(unsafe.Pointer(a1)) != 0 { bData = int32(1) - libc.Xmemcpy(tls, pOut, a2, uint64(n2)) + libc.Xmemcpy(tls, pOut, a2, uint64(uint64(n2))) pOut += uintptr(n2) } else { v4 = pOut @@ -193121,7 +193295,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe n11 = _sessionSerialLen(tls, a1) n21 = _sessionSerialLen(tls, a2) if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FabPK + uintptr(i))) != 0 || int32(*(*Tu8)(unsafe.Pointer(a2))) != int32(0xFF) { - libc.Xmemcpy(tls, pOut, a1, uint64(n11)) + libc.Xmemcpy(tls, pOut, a1, uint64(uint64(n11))) pOut += uintptr(n11) } else { v6 = pOut @@ -193135,7 +193309,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe ; i++ } - (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32(int64(pOut) - int64((*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) + (*TSessionBuffer)(unsafe.Pointer(pBuf)).FnBuf = int32(int64(int64(pOut)) - int64((*TSessionBuffer)(unsafe.Pointer(pBuf)).FaBuf)) } } } @@ -194555,7 +194729,7 @@ func _fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, var pParse uintptr _ = pParse pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse - switch int32(fts5yymajor) { + switch int32(int32(fts5yymajor)) { /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a @@ -194671,13 +194845,13 @@ func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { func _fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) (r uint8) { var i int32 _ = i - if int32(stateno) > int32(fts5YY_MAX_SHIFT) { + if int32(int32(stateno)) > int32(fts5YY_MAX_SHIFT) { return stateno } for cond := true; cond; cond = int32(1) != 0 { i = int32(_fts5yy_shift_ofst[stateno]) - i += int32(iLookAhead) - if int32(_fts5yy_lookahead[i]) != int32(iLookAhead) { + i += int32(int32(iLookAhead)) + if int32(_fts5yy_lookahead[i]) != int32(int32(iLookAhead)) { return _fts5yy_default[stateno] } else { return _fts5yy_action[i] @@ -194696,7 +194870,7 @@ func _fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) var i int32 _ = i i = int32(_fts5yy_reduce_ofst[stateno]) - i += int32(iLookAhead) + i += int32(int32(iLookAhead)) return _fts5yy_action[i] } @@ -194738,7 +194912,7 @@ func _fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, f _fts5yyStackOverflow(tls, fts5yypParser) return } - if int32(fts5yyNewState) > int32(fts5YY_MAX_SHIFT) { + if int32(int32(fts5yyNewState)) > int32(fts5YY_MAX_SHIFT) { fts5yyNewState = uint8(int32(fts5yyNewState) + (libc.Int32FromInt32(fts5YY_MIN_REDUCE) - libc.Int32FromInt32(fts5YY_MIN_SHIFTREDUCE))) } fts5yytos = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos @@ -195040,14 +195214,14 @@ _30: ; fts5yygoto = int32(_fts5yyRuleInfoLhs[fts5yyruleno]) fts5yysize = int32(_fts5yyRuleInfoNRhs[fts5yyruleno]) - fts5yyact = _fts5yy_find_reduce_action(tls, (*(*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp + uintptr(fts5yysize)*24))).Fstateno, uint8(fts5yygoto)) + fts5yyact = _fts5yy_find_reduce_action(tls, (*(*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp + uintptr(fts5yysize)*24))).Fstateno, uint8(uint8(fts5yygoto))) /* There are no SHIFTREDUCE actions on nonterminals because the table ** generator has simplified them to pure REDUCE actions. */ /* It is not possible for a REDUCE to be followed by an error */ fts5yymsp += uintptr(fts5yysize+int32(1)) * 24 (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yymsp (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fstateno = fts5yyact - (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(fts5yygoto) + (*Tfts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(uint8(fts5yygoto)) return fts5yyact } @@ -195122,9 +195296,9 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse fts5yyact = (*Tfts5yyStackEntry)(unsafe.Pointer((*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno for int32(1) != 0 { /* Exit by "break" */ - fts5yyact = _fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact) - if int32(fts5yyact) >= int32(fts5YY_MIN_REDUCE) { - fts5yyruleno = uint32(int32(fts5yyact) - int32(fts5YY_MIN_REDUCE)) /* Reduce by this rule */ + fts5yyact = _fts5yy_find_shift_action(tls, uint8(uint8(fts5yymajor)), fts5yyact) + if int32(int32(fts5yyact)) >= int32(fts5YY_MIN_REDUCE) { + fts5yyruleno = uint32(int32(int32(fts5yyact)) - int32(fts5YY_MIN_REDUCE)) /* Reduce by this rule */ /* Check that the stack is large enough to grow by a single entry ** if the RHS of the rule is empty. This ensures that there is room ** enough on the stack to push the LHS value */ @@ -195136,11 +195310,11 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y } fts5yyact = _fts5yy_reduce(tls, fts5yypParser, fts5yyruleno, fts5yymajor, fts5yyminor) } else { - if int32(fts5yyact) <= int32(fts5YY_MAX_SHIFTREDUCE) { - _fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor) + if int32(int32(fts5yyact)) <= int32(fts5YY_MAX_SHIFTREDUCE) { + _fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(uint8(fts5yymajor)), fts5yyminor) break } else { - if int32(fts5yyact) == int32(fts5YY_ACCEPT_ACTION) { + if int32(int32(fts5yyact)) == int32(fts5YY_ACCEPT_ACTION) { (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 24 _fts5yy_accept(tls, fts5yypParser) return @@ -195154,7 +195328,7 @@ func _sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5y ** they intend to abandon the parse upon the first syntax error seen. */ _fts5yy_syntax_error(tls, fts5yypParser, fts5yymajor, fts5yyminor) - _fts5yy_destructor(tls, fts5yypParser, uint8(fts5yymajor), bp) + _fts5yy_destructor(tls, fts5yypParser, uint8(uint8(fts5yymajor)), bp) break } } @@ -195530,7 +195704,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(uint64(uint64(nNew))*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -195570,7 +195744,7 @@ func _fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken break } c = *(*int8)(unsafe.Pointer((*TFts5SFinder)(unsafe.Pointer(p)).FzDoc + uintptr(i))) - if int32(c) != int32(' ') && int32(c) != int32('\t') && int32(c) != int32('\n') && int32(c) != int32('\r') { + if int32(int32(c)) != int32(' ') && int32(int32(c)) != int32('\t') && int32(int32(c)) != int32('\n') && int32(int32(c)) != int32('\r') { break } goto _1 @@ -195578,7 +195752,7 @@ func _fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken ; i-- } - if i != iStartOff-int32(1) && (int32(c) == int32('.') || int32(c) == int32(':')) { + if i != iStartOff-int32(1) && (int32(int32(c)) == int32('.') || int32(int32(c)) == int32(':')) { rc = _fts5SentenceFinderAdd(tls, p, (*TFts5SFinder)(unsafe.Pointer(p)).FiPos) } } else { @@ -195605,7 +195779,7 @@ func _fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32 iFirst = -int32(1) nScore = 0 iLast = 0 - iEnd = int64(iPos) + int64(nToken) + iEnd = int64(int64(iPos)) + int64(int64(nToken)) rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxInstCount})))(tls, pFts, bp+12) i = 0 for { @@ -195634,13 +195808,13 @@ func _fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32 *(*int32)(unsafe.Pointer(pnScore)) = nScore if piPos != 0 { iAdj = int64(iFirst - (nToken-(iLast-iFirst))/int32(2)) - if iAdj+int64(nToken) > int64(nDocsize) { + if iAdj+int64(int64(nToken)) > int64(int64(nDocsize)) { iAdj = int64(nDocsize - nToken) } if iAdj < 0 { iAdj = 0 } - *(*int32)(unsafe.Pointer(piPos)) = int32(iAdj) + *(*int32)(unsafe.Pointer(piPos)) = int32(int32(iAdj)) } return rc } @@ -195755,7 +195929,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { goto _3 } - libc.Xmemset(tls, aSeen, 0, uint64(nPhrase)) + libc.Xmemset(tls, aSeen, 0, uint64(uint64(nPhrase))) *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 156)), aSeen, i, *(*int32)(unsafe.Pointer(bp + 168)), nToken, bp+176, bp+172) if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 176)) > nBestScore { nBestScore = *(*int32)(unsafe.Pointer(bp + 176)) @@ -195778,7 +195952,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt jj++ } if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 168)) { - libc.Xmemset(tls, aSeen, 0, uint64(nPhrase)) + libc.Xmemset(tls, aSeen, 0, uint64(uint64(nPhrase))) *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 156)), aSeen, i, *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)), nToken, bp+176, uintptr(0)) if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) == 0 { v5 = int32(120) @@ -195915,11 +196089,11 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) /* Allocate the Fts5Bm25Data object */ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxPhraseCount})))(tls, pFts) nByte = int64(uint64(32) + uint64(nPhrase*int32(2))*uint64(8)) - p = Xsqlite3_malloc64(tls, uint64(nByte)) + p = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if p == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, p, 0, uint64(nByte)) + libc.Xmemset(tls, p, 0, uint64(uint64(nByte))) (*TFts5Bm25Data)(unsafe.Pointer(p)).FnPhrase = nPhrase (*TFts5Bm25Data)(unsafe.Pointer(p)).FaIDF = p + 1*32 (*TFts5Bm25Data)(unsafe.Pointer(p)).FaFreq = (*TFts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8 @@ -196127,7 +196301,7 @@ func _sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte Tu32 v1 = int32(64) } nNew = uint64(v1) - for nNew < uint64(nByte) { + for nNew < uint64(uint64(nByte)) { nNew = nNew * uint64(2) } pNew = Xsqlite3_realloc64(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, nNew) @@ -196135,7 +196309,7 @@ func _sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte Tu32 *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) return int32(1) } else { - (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = int32(nNew) + (*TFts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = int32(int32(nNew)) (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp = pNew } } @@ -196159,7 +196333,7 @@ func _sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iV if v1 != 0 { return } - *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iVal)) + *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(uint64(iVal))) } func _sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { @@ -196193,7 +196367,7 @@ func _sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nDat if v1 != 0 { return } - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pData, uint64(nData)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pData, uint64(uint64(nData))) p2 = pBuf + 8 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + nData) } @@ -196286,7 +196460,7 @@ func _sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { // */ func _sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 - _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData) + _sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(uint32(nData)), pData) } func _sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) (r int32) { @@ -196418,13 +196592,13 @@ func _sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Tsqlite3_int64) (r _ = pRet pRet = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pRet == uintptr(0) { if nByte > 0 { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } } else { - libc.Xmemset(tls, pRet, 0, uint64(nByte)) + libc.Xmemset(tls, pRet, 0, uint64(uint64(nByte))) } } return pRet @@ -196450,7 +196624,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r } zRet = Xsqlite3_malloc(tls, nIn+int32(1)) if zRet != 0 { - libc.Xmemcpy(tls, zRet, pIn, uint64(nIn)) + libc.Xmemcpy(tls, zRet, pIn, uint64(uint64(nIn))) *(*int8)(unsafe.Pointer(zRet + uintptr(nIn))) = int8('\000') } else { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) @@ -196540,7 +196714,7 @@ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { 121: uint8(1), 122: uint8(1), } - return libc.BoolInt32(int32(t)&int32(0x80) != 0 || aBareword[int32(t)] != 0) + return libc.BoolInt32(int32(int32(t))&int32(0x80) != 0 || aBareword[int32(int32(t))] != 0) } // C documentation @@ -196607,14 +196781,14 @@ func _sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, ; i-- } - hash = hash<= int32('0') && int32(a) <= int32('9')) + return libc.BoolInt32(int32(int32(a)) >= int32('0') && int32(int32(a)) <= int32('9')) } func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { @@ -196755,7 +196929,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { for int32(*(*int8)(unsafe.Pointer(p))) >= int32('a') && int32(*(*int8)(unsafe.Pointer(p))) <= int32('f') || int32(*(*int8)(unsafe.Pointer(p))) >= int32('A') && int32(*(*int8)(unsafe.Pointer(p))) <= int32('F') || int32(*(*int8)(unsafe.Pointer(p))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(p))) <= int32('9') { p++ } - if int32(*(*int8)(unsafe.Pointer(p))) == int32('\'') && 0 == (int64(p)-int64(pIn))%int64(2) { + if int32(*(*int8)(unsafe.Pointer(p))) == int32('\'') && 0 == (int64(int64(p))-int64(int64(pIn)))%int64(2) { p++ } else { p = uintptr(0) @@ -196825,12 +196999,12 @@ func _fts5Dequote(tls *libc.TLS, z uintptr) (r int32) { iOut = 0 q = *(*int8)(unsafe.Pointer(z)) /* Set stack variable q to the close-quote character */ - if int32(q) == int32('[') { + if int32(int32(q)) == int32('[') { q = int8(']') } for *(*int8)(unsafe.Pointer(z + uintptr(iIn))) != 0 { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn)))) == int32(q) { - if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn+int32(1))))) != int32(q) { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn)))) == int32(int32(q)) { + if int32(*(*int8)(unsafe.Pointer(z + uintptr(iIn+int32(1))))) != int32(int32(q)) { /* Character iIn was the close quote. */ iIn++ break @@ -196874,7 +197048,7 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { var quote int8 _ = quote /* Quote character (if any ) */ quote = *(*int8)(unsafe.Pointer(z)) - if int32(quote) == int32('[') || int32(quote) == int32('\'') || int32(quote) == int32('"') || int32(quote) == int32('`') { + if int32(int32(quote)) == int32('[') || int32(int32(quote)) == int32('\'') || int32(int32(quote)) == int32('"') || int32(int32(quote)) == int32('`') { _fts5Dequote(tls, z) } } @@ -196949,7 +197123,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC nByte = int32(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix = _sqlite3Fts5MallocZero(tls, bp, int64(int64(nByte))) if *(*int32)(unsafe.Pointer(bp)) != 0 { return *(*int32)(unsafe.Pointer(bp)) } @@ -196998,7 +197172,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC if Xsqlite3_strnicmp(tls, __ccgo_ts+35021, zCmd, nCmd) == 0 { p1 = zArg nArg = int64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, int64(uint64(8)*uint64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, int64(uint64(8)*uint64(uint64(nArg)))) pDel = _sqlite3Fts5MallocZero(tls, bp, nArg*int64(2)) pSpace = pDel if azArg != 0 && pSpace != 0 { @@ -197018,10 +197192,10 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC p1 = _fts5ConfigSkipBareword(tls, p2) } if p1 != 0 { - libc.Xmemcpy(tls, pSpace, p2, uint64(int64(p1)-int64(p2))) + libc.Xmemcpy(tls, pSpace, p2, uint64(int64(int64(p1))-int64(int64(p2)))) *(*uintptr)(unsafe.Pointer(azArg + uintptr(nArg)*8)) = pSpace _sqlite3Fts5Dequote(tls, pSpace) - pSpace += uintptr(int64(p1) - int64(p2) + int64(1)) + pSpace += uintptr(int64(int64(p1)) - int64(int64(p2)) + int64(1)) p1 = _fts5ConfigSkipWhitespace(tls, p1) } goto _1 @@ -197033,7 +197207,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35063, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5GetTokenizer(tls, pGlobal, azArg, int32(nArg), pConfig, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5GetTokenizer(tls, pGlobal, azArg, int32(int32(nArg)), pConfig, pzErr) } } } @@ -197166,7 +197340,7 @@ func _fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintpt } else { zRet = _fts5ConfigSkipBareword(tls, zIn) if zRet != 0 { - *(*int8)(unsafe.Pointer(zOut + uintptr(int64(zRet)-int64(zIn)))) = int8('\000') + *(*int8)(unsafe.Pointer(zOut + uintptr(int64(int64(zRet))-int64(int64(zIn))))) = int8('\000') } } } @@ -197277,7 +197451,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in libc.Xmemset(tls, pRet, 0, uint64(200)) (*TFts5Config)(unsafe.Pointer(pRet)).Fdb = db (*TFts5Config)(unsafe.Pointer(pRet)).FiCookie = -int32(1) - nByte = int64(uint64(nArg) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt64(1))) + nByte = int64(uint64(uint64(nArg)) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt64(1))) (*TFts5Config)(unsafe.Pointer(pRet)).FazCol = _sqlite3Fts5MallocZero(tls, bp, nByte) if (*TFts5Config)(unsafe.Pointer(pRet)).FazCol != 0 { v2 = (*TFts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*8 @@ -197563,9 +197737,9 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR pRank = p p = _fts5ConfigSkipBareword(tls, p) if p != 0 { - zRank = _sqlite3Fts5MallocZero(tls, bp, int64(uintptr(1)+p)-int64(pRank)) + zRank = _sqlite3Fts5MallocZero(tls, bp, int64(int64(uintptr(1)+p)-int64(int64(pRank)))) if zRank != 0 { - libc.Xmemcpy(tls, zRank, pRank, uint64(int64(p)-int64(pRank))) + libc.Xmemcpy(tls, zRank, pRank, uint64(int64(int64(p))-int64(int64(pRank)))) } } else { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) @@ -197585,9 +197759,9 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR if p == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { - zRankArgs = _sqlite3Fts5MallocZero(tls, bp, int64(uintptr(1)+p)-int64(pArgs)) + zRankArgs = _sqlite3Fts5MallocZero(tls, bp, int64(int64(uintptr(1)+p)-int64(int64(pArgs)))) if zRankArgs != 0 { - libc.Xmemcpy(tls, zRankArgs, pArgs, uint64(int64(p)-int64(pArgs))) + libc.Xmemcpy(tls, zRankArgs, pArgs, uint64(int64(int64(p))-int64(int64(pArgs)))) } } } @@ -197942,7 +198116,7 @@ func _sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uint } func _fts5ExprIsspace(tls *libc.TLS, t int8) (r int32) { - return libc.BoolInt32(int32(t) == int32(' ') || int32(t) == int32('\t') || int32(t) == int32('\n') || int32(t) == int32('\r')) + return libc.BoolInt32(int32(int32(t)) == int32(' ') || int32(int32(t)) == int32('\t') || int32(int32(t)) == int32('\n') || int32(int32(t)) == int32('\r')) } // C documentation @@ -198008,7 +198182,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr ; z2++ } - (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) + (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(int64(z2)) - int64(int64(z))) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35935, libc.VaList(bp+8, z)) @@ -198025,7 +198199,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr ; z21++ } - (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) + (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(int64(z21)) - int64(int64(z))) if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+35966, uint64(2)) == 0 { tok = int32(FTS5_OR) } @@ -198042,7 +198216,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } func _fts5ParseAlloc(tls *libc.TLS, t Tu64) (r uintptr) { - return Xsqlite3_malloc64(tls, uint64(int64(t))) + return Xsqlite3_malloc64(tls, uint64(int64(int64(t)))) } func _fts5ParseFree(tls *libc.TLS, p uintptr) { @@ -198077,7 +198251,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo ** implicit column-filter. */ if iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol && (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr != 0 && (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK { n = int32(8) - pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) + pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(int64(n))) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) *(*int32)(unsafe.Pointer(pColset + 4)) = iCol @@ -198094,7 +198268,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo } else { if !((*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr != 0) { nByte = int32(56) - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp+16, int64(nByte)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp+16, int64(int64(nByte))) if (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot != 0 { (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FbEof = int32(1) } @@ -198176,8 +198350,8 @@ func _sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol i aSpec[int32(1)] = int8('?') aSpec[int32(2)] = int8('[') } - for int64(i) <= nText { - if int64(i) == nText || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[0]) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[int32(1)]) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[int32(2)]) { + for int64(int64(i)) <= nText { + if int64(int64(i)) == nText || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[0]) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[int32(1)]) || int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(aSpec[int32(2)]) { if _fts5ExprCountChar(tls, zText+uintptr(iFirst), i-iFirst) >= int32(3) { v1 = iOut iOut++ @@ -198212,7 +198386,7 @@ func _sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol i if int32(*(*int8)(unsafe.Pointer(zText + uintptr(i-int32(1))))) == int32('^') { i++ } - for int64(i) < nText && int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) != int32(']') { + for int64(int64(i)) < nText && int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) != int32(']') { i++ } } @@ -198290,7 +198464,7 @@ func _sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) (r int32) { (*TFts5Expr)(unsafe.Pointer(p1)).FpRoot = _sqlite3Fts5ParseNode(tls, bp, int32(FTS5_AND), (*TFts5Expr)(unsafe.Pointer(p1)).FpRoot, (*TFts5Expr)(unsafe.Pointer(p2)).FpRoot, uintptr(0)) (*TFts5Expr)(unsafe.Pointer(p2)).FpRoot = uintptr(0) if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK { - ap = Xsqlite3_realloc(tls, (*TFts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, int32(uint64(nPhrase)*uint64(8))) + ap = Xsqlite3_realloc(tls, (*TFts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, int32(uint64(uint64(nPhrase))*uint64(8))) if ap == uintptr(0) { (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) } else { @@ -198386,13 +198560,13 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt goto _1 } if nIter == nAlloc { - nByte = int64(uint64(32) * uint64(nAlloc) * uint64(2)) - aNew = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = int64(uint64(32) * uint64(uint64(nAlloc)) * uint64(2)) + aNew = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) goto synonym_poslist_out } - libc.Xmemcpy(tls, aNew, aIter, uint64(32)*uint64(nIter)) + libc.Xmemcpy(tls, aNew, aIter, uint64(32)*uint64(uint64(nIter))) nAlloc = nAlloc * int32(2) if aIter != bp { Xsqlite3_free(tls, aIter) @@ -198447,6 +198621,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -198490,7 +198665,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat ** using sqlite3_malloc(). This approach could be improved upon. */ if (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(32)) { nByte = int64(uint64(32) * uint64((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)) - aIter = Xsqlite3_malloc64(tls, uint64(nByte)) + aIter = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if !(aIter != 0) { return int32(SQLITE_NOMEM) } @@ -198521,7 +198696,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat *(*int32)(unsafe.Pointer(bp + 136)) = (*TFts5IndexIter)(unsafe.Pointer((*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FnData } _sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*int32)(unsafe.Pointer(bp + 136)), aIter+uintptr(i)*32) - (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32))).FbFlag = uint8(bFlag) + (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32))).FbFlag = uint8(uint8(bFlag)) if (*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32))).FbEof != 0 { goto ismatch_out } @@ -198540,7 +198715,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat break } pPos = aIter + uintptr(i)*32 - iAdj = iPos + int64(i) + iAdj = iPos + int64(int64(i)) if (*TFts5PoslistReader)(unsafe.Pointer(pPos)).FiPos != iAdj { bMatch = 0 for (*TFts5PoslistReader)(unsafe.Pointer(pPos)).FiPos < iAdj { @@ -198549,7 +198724,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat } } if (*TFts5PoslistReader)(unsafe.Pointer(pPos)).FiPos > iAdj { - iPos = (*TFts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - int64(i) + iPos = (*TFts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - int64(int64(i)) } } goto _2 @@ -198579,6 +198754,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -198785,6 +198961,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -199719,18 +199896,18 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr return pNear } if pNear == uintptr(0) { - nByte = int64(uint64(32) + uint64(SZALLOC)*uint64(8)) - pRet = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = int64(uint64(32) + uint64(uint64(SZALLOC))*uint64(8)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pRet, 0, uint64(nByte)) + libc.Xmemset(tls, pRet, 0, uint64(uint64(nByte))) } } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = int64(uint64(32) + uint64(nNew)*uint64(8)) - pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte1)) + nByte1 = int64(uint64(32) + uint64(uint64(nNew))*uint64(8)) + pRet = Xsqlite3_realloc64(tls, pNear, uint64(uint64(nByte1))) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } @@ -199810,12 +199987,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui nToken = int32(FTS5_MAX_TOKEN_SIZE) } if pPhrase != 0 && (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && tflags&int32(FTS5_TOKEN_COLOCATED) != 0 { - nByte = int64(libc.Uint64FromInt64(40) + libc.Uint64FromInt64(16) + uint64(nToken) + uint64(1)) - pSyn = Xsqlite3_malloc64(tls, uint64(nByte)) + nByte = int64(libc.Uint64FromInt64(40) + libc.Uint64FromInt64(16) + uint64(uint64(nToken)) + uint64(1)) + pSyn = Xsqlite3_malloc64(tls, uint64(uint64(nByte))) if pSyn == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pSyn, 0, uint64(nByte)) + libc.Xmemset(tls, pSyn, 0, uint64(uint64(nByte))) (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm = pSyn + uintptr(40) + uintptr(16) v1 = nToken (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnQueryTerm = v1 @@ -199823,7 +200000,7 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui if (*TFts5Config)(unsafe.Pointer((*TTokenCtx)(unsafe.Pointer(pCtx)).FpConfig)).FbTokendata != 0 { (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FnQueryTerm = int32(libc.Xstrlen(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm)) } - libc.Xmemcpy(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm, pToken, uint64(nToken)) + libc.Xmemcpy(tls, (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpTerm, pToken, uint64(uint64(nToken))) (*TFts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-int32(1))*40))).FpSynonym (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-int32(1))*40))).FpSynonym = pSyn } @@ -199835,7 +200012,7 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*uint64(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(72)+uint64(40)*uint64(uint64(nNew)))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { @@ -199911,7 +200088,7 @@ func _parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) (r int32) { _, _ = apNew, nByte if (*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase%int32(8) == 0 { nByte = int64(uint64(8) * uint64((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase+libc.Int32FromInt32(8))) - apNew = Xsqlite3_realloc64(tls, (*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) + apNew = Xsqlite3_realloc64(tls, (*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(uint64(nByte))) if apNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) return int32(SQLITE_NOMEM) @@ -199977,7 +200154,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { - (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = uint8(bPrefix) + (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = uint8(uint8(bPrefix)) } } *(*uintptr)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((*TFts5Parse)(unsafe.Pointer(pParse)).FnPhrase-int32(1))*8)) = (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase @@ -200025,7 +200202,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp nByte = int64(uint64(8) + uint64((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { - libc.Xmemcpy(tls, pColset, pColsetOrig, uint64(nByte)) + libc.Xmemcpy(tls, pColset, pColsetOrig, uint64(uint64(nByte))) } (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FpColset = pColset } @@ -200121,7 +200298,7 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, break } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) - if int32(c) < int32('0') || int32(c) > int32('9') { + if int32(int32(c)) < int32('0') || int32(int32(c)) > int32('9') { _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35978, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } @@ -200159,7 +200336,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*uint64(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(uint64(8)+uint64(4)*uint64(uint64(nCol)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -200209,7 +200386,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(uint64(8)+uint64(4)*uint64(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(uint64(8)+uint64(4)*uint64(uint64(nCol)))) if pRet != 0 { iOld = 0 i = 0 @@ -200290,7 +200467,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { nByte = int64(uint64(8) + uint64((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { - libc.Xmemcpy(tls, pRet, pOrig, uint64(nByte)) + libc.Xmemcpy(tls, pRet, pOrig, uint64(uint64(nByte))) } } else { pRet = uintptr(0) @@ -200420,7 +200597,7 @@ func _fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { ii = (*TFts5ExprNode)(unsafe.Pointer(p)).FnChild if (*TFts5ExprNode)(unsafe.Pointer(p)).FeType != int32(FTS5_NOT) && (*TFts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*TFts5ExprNode)(unsafe.Pointer(p)).FeType { nByte = int32(uint64(8) * uint64((*TFts5ExprNode)(unsafe.Pointer(pSub)).FnChild)) - libc.Xmemcpy(tls, p+48+uintptr((*TFts5ExprNode)(unsafe.Pointer(p)).FnChild)*8, pSub+48, uint64(nByte)) + libc.Xmemcpy(tls, p+48+uintptr((*TFts5ExprNode)(unsafe.Pointer(p)).FnChild)*8, pSub+48, uint64(uint64(nByte))) *(*int32)(unsafe.Pointer(p + 40)) += (*TFts5ExprNode)(unsafe.Pointer(pSub)).FnChild Xsqlite3_free(tls, pSub) } else { @@ -200464,8 +200641,8 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = int32(uint64(56) + uint64(nTerm)*uint64(8)) - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) + nByte = int32(uint64(56) + uint64(uint64(nTerm))*uint64(8)) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(int64(nByte))) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) (*TFts5ExprNode)(unsafe.Pointer(pRet)).FnChild = nTerm @@ -200734,7 +200911,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*uint64((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*uint64((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*uint64((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -200888,7 +201065,7 @@ func _sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uint _, _, _ = i, pColset, pNode (*(*TFts5ExprCtx)(unsafe.Pointer(bp))).FpExpr = pExpr (*(*TFts5ExprCtx)(unsafe.Pointer(bp))).FaPopulator = aPopulator - (*(*TFts5ExprCtx)(unsafe.Pointer(bp))).FiOff = int64(iCol)<= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*48, pTerm, uint64(nTerm)) { + if pTerm == uintptr(0) || (*TFts5HashEntry)(unsafe.Pointer(pIter)).FnKey >= nTerm && 0 == libc.Xmemcmp(tls, pIter+1*48, pTerm, uint64(uint64(nTerm))) { pEntry = pIter (*TFts5HashEntry)(unsafe.Pointer(pEntry)).FpScanNext = uintptr(0) i = 0 @@ -201717,7 +201894,7 @@ func _sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintp break } zKey = p + 1*48 - if nTerm == (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey && libc.Xmemcmp(tls, zKey, pTerm, uint64(nTerm)) == 0 { + if nTerm == (*TFts5HashEntry)(unsafe.Pointer(p)).FnKey && libc.Xmemcmp(tls, zKey, pTerm, uint64(uint64(nTerm))) == 0 { break } goto _1 @@ -201726,14 +201903,14 @@ func _sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintp p = (*TFts5HashEntry)(unsafe.Pointer(p)).FpHashNext } if p != 0 { - nHashPre = int32(uint64(48) + uint64(nTerm)) + nHashPre = int32(uint64(48) + uint64(uint64(nTerm))) nList = (*TFts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre v2 = Xsqlite3_malloc64(tls, uint64(nPre+nList+int32(10))) *(*uintptr)(unsafe.Pointer(ppOut)) = v2 pRet = v2 if pRet != 0 { pFaux = pRet + uintptr(nPre-nHashPre) - libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), uint64(nList)) + libc.Xmemcpy(tls, pRet+uintptr(nPre), p+uintptr(nHashPre), uint64(uint64(nList))) nList += _fts5HashAddPoslistSize(tls, pHash, p, pFaux) *(*int32)(unsafe.Pointer(pnDoclist)) = nList } else { @@ -201781,7 +201958,7 @@ func _sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, pnT *(*uintptr)(unsafe.Pointer(pzTerm)) = zKey *(*int32)(unsafe.Pointer(pnTerm)) = nTerm *(*uintptr)(unsafe.Pointer(ppDoclist)) = zKey + uintptr(nTerm) - *(*int32)(unsafe.Pointer(pnDoclist)) = int32(uint64((*TFts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint64(48) + uint64(nTerm))) + *(*int32)(unsafe.Pointer(pnDoclist)) = int32(uint64((*TFts5HashEntry)(unsafe.Pointer(p)).FnData) - (uint64(48) + uint64(uint64(nTerm)))) } else { *(*uintptr)(unsafe.Pointer(pzTerm)) = uintptr(0) *(*int32)(unsafe.Pointer(pnTerm)) = 0 @@ -202565,8 +202742,8 @@ type TFts5DlidxIter1 = struct { type Fts5DlidxIter1 = TFts5DlidxIter1 func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { - *(*Tu8)(unsafe.Pointer(aOut)) = uint8(int32(iVal) >> libc.Int32FromInt32(8)) - *(*Tu8)(unsafe.Pointer(aOut + 1)) = uint8(int32(iVal) & libc.Int32FromInt32(0xFF)) + *(*Tu8)(unsafe.Pointer(aOut)) = uint8(int32(int32(iVal)) >> libc.Int32FromInt32(8)) + *(*Tu8)(unsafe.Pointer(aOut + 1)) = uint8(int32(int32(iVal)) & libc.Int32FromInt32(0xFF)) } func _fts5GetU16(tls *libc.TLS, aIn uintptr) (r Tu16) { @@ -202751,8 +202928,8 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { if rc == SQLITE_OK { aOut = uintptr(0) /* Read blob data into this buffer */ nByte = Xsqlite3_blob_bytes(tls, (*TFts5Index)(unsafe.Pointer(p)).FpReader) - nAlloc = int64(uint64(16) + uint64(nByte) + uint64(FTS5_DATA_PADDING)) - pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) + nAlloc = int64(uint64(16) + uint64(uint64(nByte)) + uint64(FTS5_DATA_PADDING)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(nAlloc))) if pRet != 0 { (*TFts5Data)(unsafe.Pointer(pRet)).Fnn = nByte v1 = pRet + 1*16 @@ -202975,7 +203152,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { nByte = int64(uint64(48) + uint64((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { - libc.Xmemcpy(tls, pNew, p, uint64(nByte)) + libc.Xmemcpy(tls, pNew, p, uint64(uint64(nByte))) i = 0 for { if !(i < (*TFts5Structure)(unsafe.Pointer(p)).FnLevel) { @@ -203010,7 +203187,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { Xsqlite3_free(tls, pNew) return } - libc.Xmemcpy(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*(*TFts5StructureLevel)(unsafe.Pointer(p + 32 + uintptr(i)*16))).FaSeg, uint64(nByte)) + libc.Xmemcpy(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*(*TFts5StructureLevel)(unsafe.Pointer(p + 32 + uintptr(i)*16))).FaSeg, uint64(uint64(nByte))) goto _2 _2: ; @@ -203179,7 +203356,7 @@ func _fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { pStruct = *(*uintptr)(unsafe.Pointer(ppStruct)) nLevel = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel nByte = int64(libc.Uint64FromInt64(48) + libc.Uint64FromInt64(16)*uint64(nLevel+libc.Int32FromInt32(1))) - pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(nByte)) + pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(uint64(nByte))) if pStruct != 0 { libc.Xmemset(tls, pStruct+32+uintptr(nLevel)*16, 0, uint64(16)) (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel++ @@ -203204,14 +203381,14 @@ func _fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pLvl = pStruct + 32 + uintptr(iLvl)*16 nByte = int64(uint64((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg+nExtra) * uint64(56)) - aNew = Xsqlite3_realloc64(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(nByte)) + aNew = Xsqlite3_realloc64(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(uint64(nByte))) if aNew != 0 { if bInsert == 0 { - libc.Xmemset(tls, aNew+uintptr((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*56, 0, uint64(56)*uint64(nExtra)) + libc.Xmemset(tls, aNew+uintptr((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*56, 0, uint64(56)*uint64(uint64(nExtra))) } else { nMove = int32(uint64((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint64(56)) - libc.Xmemmove(tls, aNew+uintptr(nExtra)*56, aNew, uint64(nMove)) - libc.Xmemset(tls, aNew, 0, uint64(56)*uint64(nExtra)) + libc.Xmemmove(tls, aNew+uintptr(nExtra)*56, aNew, uint64(uint64(nMove))) + libc.Xmemset(tls, aNew, 0, uint64(56)*uint64(uint64(nExtra))) } (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = aNew } else { @@ -203334,7 +203511,7 @@ func _fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { if iCookie < 0 { iCookie = 0 } - if 0 == _sqlite3Fts5BufferSize(tls, p+60, bp, uint32(nHdr)) { + if 0 == _sqlite3Fts5BufferSize(tls, p+60, bp, uint32(uint32(nHdr))) { _sqlite3Fts5Put32(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, iCookie) (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = int32(4) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr > uint64(0) { @@ -203755,8 +203932,8 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = int64(uint64(40) + uint64(i)*uint64(32)) - pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte)) + nByte = int64(uint64(40) + uint64(uint64(i))*uint64(32)) + pNew = Xsqlite3_realloc64(tls, pIter, uint64(uint64(nByte))) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -203908,7 +204085,7 @@ func _fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { (*TFts5SegIter)(unsafe.Pointer(pIter)).FbDel = uint8(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0x0001)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FnPos = *(*int32)(unsafe.Pointer(bp)) >> int32(1) } - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(int64(iOff)) } } @@ -203968,7 +204145,7 @@ func _fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) (*TFts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn = nKeep _sqlite3Fts5BufferAppendBlob(tls, p+60, pIter+96, uint32(*(*int32)(unsafe.Pointer(bp))), a+uintptr(iOff)) iOff += int64(*(*int32)(unsafe.Pointer(bp))) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32(iOff) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = int32(int32(iOff)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff if (*TFts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff >= (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn { @@ -204005,8 +204182,8 @@ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _ = nByte, nTomb, pNew nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone if nTomb > 0 { - nByte = int32(uint64(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = int32(uint64(uint64(nTomb))*uint64(8) + uint64(16)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(int64(nByte))) if pNew != 0 { (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) @@ -204109,7 +204286,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(uint64(uint64(nNew))*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -204120,7 +204297,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { v2 = iRowidOffset iRowidOffset++ *(*int32)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr(v2)*4)) = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) - (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(i) + (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(int64(i)) } (*TFts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset = iRowidOffset _fts5SegIterLoadNPos(tls, p, pIter) @@ -204156,7 +204333,7 @@ func _fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<= (*TFts5Data)(unsafe.Pointer(pLast)).Fnn { (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*TFts5Data)(unsafe.Pointer(pLast)).Fnn + int32(1) } else { @@ -204598,10 +204776,10 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin goto search_failed } if *(*Tu32)(unsafe.Pointer(bp + 4)) == nMatch { - if *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(nTerm)-nMatch { + if *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(uint32(nTerm))-nMatch { v2 = *(*Tu32)(unsafe.Pointer(bp + 8)) } else { - v2 = uint32(nTerm) - nMatch + v2 = uint32(uint32(nTerm)) - nMatch } nCmp = v2 i = uint32(0) @@ -204618,7 +204796,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin i++ } nMatch += i - if uint32(nTerm) == nMatch { + if uint32(uint32(nTerm)) == nMatch { if i == *(*Tu32)(unsafe.Pointer(bp + 8)) { goto search_success } else { @@ -204650,6 +204828,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -204681,9 +204860,10 @@ search_failed: } } } + goto search_success search_success: ; - if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { + if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(int64(n)) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { (*TFts5Index)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<= nSeg */ nSlot = int64(2) for { - if !(nSlot < int64(nSeg)) { + if !(nSlot < int64(int64(nSeg))) { break } goto _1 @@ -205446,9 +205626,9 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, int64(uint64(232)+uint64(128)*uint64(nSlot-libc.Int64FromInt32(1))+uint64(4)*uint64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, int64(uint64(232)+uint64(128)*uint64(nSlot-libc.Int64FromInt32(1))+uint64(4)*uint64(uint64(nSlot)))) if pNew != 0 { - (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) + (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(int32(nSlot)) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 (*TFts5Iter)(unsafe.Pointer(pNew)).FpIndex = p (*TFts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs = __ccgo_fp(_fts5IterSetOutputs_Noop) @@ -205459,7 +205639,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { func _fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { _ = pUnused if nChunk > 0 { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, uint64(nChunk)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pContext)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pContext)).Fn), pChunk, uint64(uint64(nChunk))) *(*int32)(unsafe.Pointer(pContext + 8)) += nChunk } } @@ -205730,7 +205910,7 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u pEnd = p + uintptr(nPos) /* One byte past end of position list */ i = 0 *(*int32)(unsafe.Pointer(bp)) = 0 - if (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol > int32(1) && _sqlite3Fts5BufferSize(tls, pRc, pIter+40, uint32(nPos)) != 0 { + if (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol > int32(1) && _sqlite3Fts5BufferSize(tls, pRc, pIter+40, uint32(uint32(nPos))) != 0 { return } for int32(1) != 0 { @@ -205756,12 +205936,12 @@ func _fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos u if *(*int32)(unsafe.Pointer(pColset + 4 + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp)) { if (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol == int32(1) { (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = aCopy - (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32(int64(p) - int64(aCopy)) + (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32(int64(int64(p)) - int64(int64(aCopy))) return } - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pIter+40)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pIter+40)).Fn), aCopy, uint64(int64(p)-int64(aCopy))) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pIter+40)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pIter+40)).Fn), aCopy, uint64(int64(int64(p))-int64(int64(aCopy)))) p2 = pIter + 40 + 8 - *(*int32)(unsafe.Pointer(p2)) = int32(int64(*(*int32)(unsafe.Pointer(p2))) + (int64(p) - int64(aCopy))) + *(*int32)(unsafe.Pointer(p2)) = int32(int64(*(*int32)(unsafe.Pointer(p2))) + (int64(int64(p)) - int64(int64(aCopy)))) } if p >= pEnd { (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -205885,10 +206065,11 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp - (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32(int64(aOut) - int64((*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) + (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = int32(int64(int64(aOut)) - int64((*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) } } @@ -206102,6 +206283,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -206354,7 +206536,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*uint64(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*uint64(uint64(nLvl)))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -206419,7 +206601,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* The following was already done in fts5WriteInit(): */ /* sqlite3_bind_int(p->pIdxWriter, 1, pWriter->iSegid); */ Xsqlite3_bind_blob(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter, int32(2), z, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn, libc.UintptrFromInt32(0)) - Xsqlite3_bind_int64(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter, int32(3), int64(bFlag)+int64((*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage)< 0 { - _sqlite3Fts5BufferAppendBlob(tls, p+60, pPage+8, uint32(n), a) + _sqlite3Fts5BufferAppendBlob(tls, p+60, pPage+8, uint32(uint32(n)), a) } } @@ -206764,8 +206946,8 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = uint8(1) (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = int32(1) /* Grow the two buffers to pgsz + padding bytes in size. */ - _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+24, uint32(nBuffer)) - _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, uint32(nBuffer)) + _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+24, uint32(uint32(nBuffer))) + _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, uint32(uint32(nBuffer))) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+36510, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) @@ -206843,7 +207025,7 @@ func _fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { _sqlite3Fts5BufferAppendVarint(tls, p+60, bp, libc.Int64FromInt32(4)) if (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno && (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf && (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*TFts5Data)(unsafe.Pointer(pData)).Fnn { nDiff = (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf - (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist - _sqlite3Fts5BufferAppendVarint(tls, p+60, bp, int64((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn)-int64(1)-int64(nDiff)-int64(4)) + _sqlite3Fts5BufferAppendVarint(tls, p+60, bp, int64((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn)-int64(1)-int64(int64(nDiff))-int64(4)) _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32((*TFts5Data)(unsafe.Pointer(pData)).Fnn-(*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff), (*TFts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*TFts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)) } (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno @@ -206979,7 +207161,7 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 } else { /* Append the position-list data to the output */ nPos = (*TFts5SegIter)(unsafe.Pointer(pSegIter)).FnPos*int32(2) + int32((*TFts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) - _sqlite3Fts5BufferAppendVarint(tls, p+60, bp+8+8+8, int64(nPos)) + _sqlite3Fts5BufferAppendVarint(tls, p+60, bp+8+8+8, int64(int64(nPos))) _fts5ChunkIterate(tls, p, pSegIter, bp+8, __ccgo_fp(_fts5MergeChunkCallback)) } goto _2 @@ -207008,7 +207190,7 @@ func _fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32 /* Remove the redundant segments from the input level */ if (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg != nInput { nMove = int32(uint64((*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg-nInput) * uint64(56)) - libc.Xmemmove(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*56, uint64(nMove)) + libc.Xmemmove(tls, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(nInput)*56, uint64(uint64(nMove))) } *(*int32)(unsafe.Pointer(pStruct + 24)) -= nInput *(*int32)(unsafe.Pointer(pLvl + 4)) -= nInput @@ -207166,8 +207348,8 @@ func _fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32 pStruct = *(*uintptr)(unsafe.Pointer(ppStruct)) /* Number of leaf pages left to write */ /* Update the write-counter. While doing so, set nWork. */ nWrite = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter - nWork = int32((nWrite+uint64(nLeaf))/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit)) - *(*Tu64)(unsafe.Pointer(pStruct + 8)) += uint64(nLeaf) + nWork = int32((nWrite+uint64(uint64(nLeaf)))/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit) - nWrite/uint64((*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit)) + *(*Tu64)(unsafe.Pointer(pStruct + 8)) += uint64(uint64(nLeaf)) nRem = (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork * (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel _fts5IndexMerge(tls, p, ppStruct, nRem, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge) } @@ -207364,12 +207546,12 @@ func _fts5SecureDeleteOverflow(tls *libc.TLS, p uintptr, pSeg uintptr, iPgno int ** in bytes. The new page is always smaller than the old. */ nPg = (*TFts5Data)(unsafe.Pointer(pLeaf)).FszLeaf - nShift libc.Xmemmove(tls, aPg+4, aPg+uintptr(int32(4)+nShift), uint64(nPg-int32(4))) - _fts5PutU16(tls, aPg+2, uint16(nPg)) + _fts5PutU16(tls, aPg+2, uint16(uint16(nPg))) if _fts5GetU16(tls, aPg) != 0 { _fts5PutU16(tls, aPg, uint16(4)) } if nIdx > 0 { - libc.Xmemcpy(tls, aPg+uintptr(nPg), aIdx, uint64(nIdx)) + libc.Xmemcpy(tls, aPg+uintptr(nPg), aIdx, uint64(uint64(nIdx))) nPg += nIdx } Xsqlite3_free(tls, aIdx) @@ -207431,7 +207613,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } - libc.Xmemcpy(tls, aIdx, aPg+uintptr(iPgIdx), uint64(nIdx)) + libc.Xmemcpy(tls, aIdx, aPg+uintptr(iPgIdx), uint64(uint64(nIdx))) /* At this point segment iterator pSeg points to the entry ** this function should remove from the b-tree segment. ** @@ -207470,7 +207652,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { } iSOP = iStart + int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) if bDetailNone != 0 { - for int64(iSOP) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { + for int64(int64(iSOP)) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { if int32(*(*Tu8)(unsafe.Pointer(aPg + uintptr(iSOP)))) == 0x00 { iSOP++ } @@ -207490,7 +207672,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 iSOP += _sqlite3Fts5GetVarint32(tls, aPg+uintptr(iSOP), bp+12) - for int64(iSOP) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { + for int64(int64(iSOP)) < (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset { iStart = iSOP + *(*int32)(unsafe.Pointer(bp + 12))/int32(2) iSOP = iStart + int32(_sqlite3Fts5GetVarint(tls, aPg+uintptr(iStart), bp)) iSOP += _sqlite3Fts5GetVarint32(tls, aPg+uintptr(iSOP), bp+12) @@ -207565,7 +207747,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { } *(*Tu32)(unsafe.Pointer(bp + 32)) = uint32(0) iIdx += _sqlite3Fts5GetVarint32(tls, aIdx+uintptr(iIdx), bp+32) - if uint32(iKeyOff1)+*(*Tu32)(unsafe.Pointer(bp + 32)) > uint32(iStart) { + if uint32(uint32(iKeyOff1))+*(*Tu32)(unsafe.Pointer(bp + 32)) > uint32(uint32(iStart)) { break } iKeyOff1 = int32(uint32(iKeyOff1) + *(*Tu32)(unsafe.Pointer(bp + 32))) @@ -207660,8 +207842,8 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iTermIdx += nByte } nTermIdx = iTermIdx - libc.Xmemmove(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr(iTermOff), (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr((*TFts5Data)(unsafe.Pointer(pTerm)).FszLeaf), uint64(nTermIdx)) - _fts5PutU16(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+2, uint16(iTermOff)) + libc.Xmemmove(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr(iTermOff), (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+uintptr((*TFts5Data)(unsafe.Pointer(pTerm)).FszLeaf), uint64(uint64(nTermIdx))) + _fts5PutU16(tls, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp+2, uint16(uint16(iTermOff))) _fts5DataWrite(tls, p, iId, (*TFts5Data)(unsafe.Pointer(pTerm)).Fp, iTermOff+nTermIdx) if nTermIdx == 0 { _fts5SecureDeleteIdxEntry(tls, p, iSegid, (*TFts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno) @@ -207687,10 +207869,10 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { nShift = iNextOff - iOff /* Distance to move them */ iPrevKeyOut = 0 iKeyIn = 0 - libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), uint64(nMove)) + libc.Xmemmove(tls, aPg+uintptr(iOff), aPg+uintptr(iNextOff), uint64(uint64(nMove))) iPgIdx -= nShift nPg = iPgIdx - _fts5PutU16(tls, aPg+2, uint16(iPgIdx)) + _fts5PutU16(tls, aPg+2, uint16(uint16(iPgIdx))) iIdx = 0 for { if !(iIdx < nIdx) { @@ -207856,11 +208038,11 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } if (*(*TFts5SegWriter)(unsafe.Pointer(bp + 16))).FbFirstRowidInPage != 0 { _fts5PutU16(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, uint16((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn)) /* first rowid on page */ - *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(iRowid)) + *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(uint64(iRowid))) (*(*TFts5SegWriter)(unsafe.Pointer(bp + 16))).FbFirstRowidInPage = uint8(0) _fts5WriteDlidxAppend(tls, p, bp+16, iRowid) } else { - iRowidDelta = uint64(iRowid) - uint64(iPrev) + iRowidDelta = uint64(uint64(iRowid)) - uint64(uint64(iPrev)) *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), iRowidDelta) } if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK { @@ -207899,7 +208081,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { if (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn+nCopy <= pgsz { /* The entire poslist will fit on the current leaf. So copy ** it in one go. */ - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 152))+uintptr(iOff), uint64(nCopy)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), *(*uintptr)(unsafe.Pointer(bp + 152))+uintptr(iOff), uint64(uint64(nCopy))) *(*int32)(unsafe.Pointer(pBuf + 8)) += nCopy } else { /* The entire poslist will not fit on this leaf. So it needs @@ -207915,7 +208097,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } else { n = _fts5PoslistPrefix(tls, pPoslist+uintptr(iPos), nSpace) } - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), uint64(n)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), pPoslist+uintptr(iPos), uint64(uint64(n))) *(*int32)(unsafe.Pointer(pBuf + 8)) += n iPos += n if (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*TFts5Buffer)(unsafe.Pointer(pPgidx)).Fn >= pgsz { @@ -208037,10 +208219,10 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16))) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - nByte = int64(uint64(nSeg) * uint64(56)) + nByte = int64(uint64(uint64(nSeg)) * uint64(56)) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+int32(1) < int32(FTS5_MAX_LEVEL) { v2 = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel + int32(1) } else { @@ -208165,7 +208347,7 @@ func _sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) (r int32) { func _fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta Tu64, pUnused uintptr, pBuf uintptr) { _ = pUnused - _sqlite3Fts5BufferAppendVarint(tls, p+60, pBuf, int64(iDelta)) + _sqlite3Fts5BufferAppendVarint(tls, p+60, pBuf, int64(int64(iDelta))) } func _fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta Tu64, pMulti uintptr, pBuf uintptr) { @@ -208184,7 +208366,7 @@ func _fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta Tu64, pMulti uintptr, p if v2 && 0 == v1 { *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), iDelta) *(*int32)(unsafe.Pointer(pBuf + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), uint64(nData*libc.Int32FromInt32(2))) - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*TFts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint64(nData)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), (*TFts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint64(uint64(nData))) *(*int32)(unsafe.Pointer(pBuf + 8)) += nData libc.Xmemset(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn), 0, uint64(FTS5_DATA_ZERO_PADDING)) } @@ -208410,7 +208592,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu ** (the value PoslistNext64() uses for EOF) as a position and appending ** it to the output. This can happen at most once for each input ** position-list, hence (nBuf+1) 10 byte paddings. */ - if _sqlite3Fts5BufferSize(tls, p+60, bp+1032, uint32(nOut)) != 0 { + if _sqlite3Fts5BufferSize(tls, p+60, bp+1032, uint32(uint32(nOut))) != 0 { return } for *(*uintptr)(unsafe.Pointer(bp + 1024)) != 0 { @@ -208476,7 +208658,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*(*TFts5Buffer)(unsafe.Pointer(bp + 1048))).Fp, uint64((*(*TFts5Buffer)(unsafe.Pointer(bp + 1048))).Fn)) *(*int32)(unsafe.Pointer(bp + 1032 + 8)) += (*(*TFts5Buffer)(unsafe.Pointer(bp + 1048))).Fn if nTail > 0 { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FaPos+uintptr((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiOff), uint64(nTail)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp+1032)).Fn), (*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FaPos+uintptr((*TPrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024)))).FiOff), uint64(uint64(nTail))) *(*int32)(unsafe.Pointer(bp + 1032 + 8)) += nTail } *(*uintptr)(unsafe.Pointer(bp + 1024)) = pSave @@ -208534,7 +208716,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo xMerge = __ccgo_fp(_fts5MergePrefixLists) xAppend = __ccgo_fp(_fts5AppendPoslist) } - aBuf = _fts5IdxMalloc(tls, p, int64(uint64(16)*uint64(nBuf))) + aBuf = _fts5IdxMalloc(tls, p, int64(uint64(16)*uint64(uint64(nBuf)))) pStruct = _fts5StructureRead(tls, p) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { flags = libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN) | libc.Int32FromInt32(FTS5INDEX_QUERY_SKIPEMPTY) | libc.Int32FromInt32(FTS5INDEX_QUERY_NOOUTPUT) @@ -208560,7 +208742,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo pSeg = *(*uintptr)(unsafe.Pointer(bp)) + 104 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*128 (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg) if (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FnData != 0 { - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+8) + (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(uint64(iLastRowid)), *(*uintptr)(unsafe.Pointer(bp)), bp+8) iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid } goto _1 @@ -208582,7 +208764,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo pTerm = (*TFts5SegIter)(unsafe.Pointer(pSeg1)).Fterm.Fp (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg1) if *(*int32)(unsafe.Pointer(bp + 24)) != 0 { - if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, uint64(nToken)) != 0 { + if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, uint64(uint64(nToken))) != 0 { break } } @@ -208632,7 +208814,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo } iLastRowid = 0 } - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+8) + (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, uint64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-uint64(uint64(iLastRowid)), *(*uintptr)(unsafe.Pointer(bp)), bp+8) iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid goto _2 _2: @@ -208933,7 +209115,7 @@ func _sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pT // ** token pToken/nToken. // */ func _fts5IsTokendataPrefix(tls *libc.TLS, pBuf uintptr, pToken uintptr, nToken int32) (r int32) { - return libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn >= nToken && 0 == libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, pToken, uint64(nToken)) && ((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn == nToken || int32(*(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(nToken)))) == 0x00)) + return libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn >= nToken && 0 == libc.Xmemcmp(tls, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, pToken, uint64(uint64(nToken))) && ((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn == nToken || int32(*(*Tu8)(unsafe.Pointer((*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(nToken)))) == 0x00)) } // C documentation @@ -208999,13 +209181,13 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = int32(uint64(nAlloc)*uint64(8) + uint64(48)) + nByte = int32(uint64(uint64(nAlloc))*uint64(8) + uint64(48)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { if pIn == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(nByte)) + libc.Xmemset(tls, pNew, 0, uint64(uint64(nByte))) } pRet = pNew (*TFts5TokenDataIter)(unsafe.Pointer(pNew)).FnIterAlloc = nAlloc @@ -209066,7 +209248,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int v1 = int32(64) } nNew = v1 - nByte = int32(uint64(nNew) * uint64(24)) + nByte = int32(uint64(uint64(nNew)) * uint64(24)) aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, nByte) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -209180,7 +209362,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { /* Ensure the token-mapping is large enough */ if eDetail == FTS5_DETAIL_FULL && (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap+nByte { nNew = ((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc + nByte) * int32(2) - aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, int32(uint64(nNew)*uint64(24))) + aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, int32(uint64(uint64(nNew))*uint64(24))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex)).Frc = int32(SQLITE_NOMEM) return @@ -209482,7 +209664,7 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int iPrefixIdx = 0 /* +1 prefix index */ bTokendata = (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata if nToken > 0 { - libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp+1, pToken, uint64(nToken)) + libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp+1, pToken, uint64(uint64(nToken))) } if flags&(libc.Int32FromInt32(FTS5INDEX_QUERY_NOTOKENDATA)|libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN)) != 0 { bTokendata = 0 @@ -209654,7 +209836,7 @@ func _sqlite3Fts5IterToken(tls *libc.TLS, pIndexIter uintptr, iRowid Ti64, iCol pIter = pIndexIter pT = (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter aMap = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap - iPos = int64(iCol)< uint64(0xFFFFFFFF) { return int32(2) @@ -209927,7 +210109,7 @@ func _fts5IndexTombstoneAddToPage(tls *libc.TLS, pPg uintptr, bForce int32, nPg return 0 } } - _fts5PutU32(tls, aSlot+uintptr(iSlot)*4, uint32(iRowid)) + _fts5PutU32(tls, aSlot+uintptr(iSlot)*4, uint32(uint32(iRowid))) } else { aSlot1 = (*TFts5Data)(unsafe.Pointer(pPg)).Fp + 8 for *(*Tu64)(unsafe.Pointer(aSlot1 + uintptr(iSlot)*8)) != 0 { @@ -209969,7 +210151,7 @@ func _fts5IndexTombstoneRehash(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 ui if !(ii < nOut) { break } - *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*8)))).Fp)) = uint8(szKey) + *(*Tu8)(unsafe.Pointer((*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*8)))).Fp)) = uint8(uint8(szKey)) _fts5PutU32(tls, (*TFts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(apOut + uintptr(ii)*8)))).Fp+4, uint32(0)) goto _1 _1: @@ -210019,7 +210201,7 @@ func _fts5IndexTombstoneRehash(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 ui } /* If iVal is not 0 at this point, insert it into the new hash table */ if iVal != 0 { - pPg = *(*uintptr)(unsafe.Pointer(apOut + uintptr(iVal%uint64(nOut))*8)) + pPg = *(*uintptr)(unsafe.Pointer(apOut + uintptr(iVal%uint64(uint64(nOut)))*8)) res = _fts5IndexTombstoneAddToPage(tls, pPg, 0, nOut, iVal) if res != 0 { break @@ -210123,14 +210305,14 @@ func _fts5IndexTombstoneRebuild(tls *libc.TLS, p uintptr, pSeg uintptr, pData1 u szPage = 0 apOut = uintptr(0) /* Allocate space for the new hash table */ - apOut = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(8)*uint64(nOut))) + apOut = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(8)*uint64(uint64(nOut)))) szPage = int32(8) + nSlot*szKey ii = 0 for { if !(ii < nOut) { break } - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(16)+uint64(szPage))) + pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(16)+uint64(uint64(szPage)))) if pNew != 0 { (*TFts5Data)(unsafe.Pointer(pNew)).Fnn = szPage (*TFts5Data)(unsafe.Pointer(pNew)).Fp = pNew + 1*16 @@ -210261,12 +210443,12 @@ func _sqlite3Fts5IndexContentlessDelete(tls *libc.TLS, p uintptr, iOrigin Ti64, break } pSeg = (*(*TFts5StructureLevel)(unsafe.Pointer(pStruct + 32 + uintptr(iLvl)*16))).FaSeg + uintptr(iSeg)*56 - if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1 <= uint64(iOrigin) && (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 >= uint64(iOrigin) { + if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin1 <= uint64(uint64(iOrigin)) && (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiOrigin2 >= uint64(uint64(iOrigin)) { if bFound == 0 { (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FnEntryTombstone++ bFound = int32(1) } - _fts5IndexTombstoneAdd(tls, p, pSeg, uint64(iRowid)) + _fts5IndexTombstoneAdd(tls, p, pSeg, uint64(uint64(iRowid))) } goto _2 _2: @@ -210298,9 +210480,9 @@ func _sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid Ti64, iCol int32, iPos in var i int32 var ret Tu64 _, _ = i, ret - ret = uint64(iRowid) - ret += ret<= 0 { ret += ret<= int32('A') && int32(c) <= int32('Z') { + if int32(int32(c)) >= int32('A') && int32(int32(c)) <= int32('Z') { c = int8(int32(c) + libc.Int32FromInt32(32)) } *(*int8)(unsafe.Pointer(aOut + uintptr(i))) = c @@ -215590,7 +215773,7 @@ func _fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused if pFold != bp { Xsqlite3_free(tls, pFold) } - pFold = Xsqlite3_malloc64(tls, uint64(int64(nByte)*int64(2))) + pFold = Xsqlite3_malloc64(tls, uint64(int64(int64(nByte))*int64(2))) if pFold == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -215655,7 +215838,7 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars rc = SQLITE_OK n = int32(libc.Xstrlen(tls, z)) if n > 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(uint64(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -215676,10 +215859,10 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars } } if iCode < uint32(128) { - *(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = uint8(bTokenChars) + *(*uint8)(unsafe.Pointer(p + uintptr(iCode))) = uint8(uint8(bTokenChars)) } else { bToken = int32(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, iCode))))) - if bToken != bTokenChars && _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0 { + if bToken != bTokenChars && _sqlite3Fts5UnicodeIsdiacritic(tls, int32(int32(iCode))) == 0 { i = 0 for { if !(i < nNew) { @@ -215694,7 +215877,7 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars i++ } libc.Xmemmove(tls, aNew+uintptr(i+int32(1))*4, aNew+uintptr(i)*4, uint64(nNew-i)*uint64(4)) - *(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(iCode) + *(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(int32(iCode)) nNew++ } } @@ -215794,7 +215977,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(uint64((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -215867,7 +216050,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 // ** character (not a separator). // */ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { - return int32(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, uint32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) + return int32(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, uint32(uint32(iCode))))))) ^ _fts5UnicodeIsException(tls, p, iCode) } func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { @@ -215901,7 +216084,7 @@ _2: if int32(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0x80) != 0 { /* A character outside of the ascii range. Skip past it if it is ** a separator character. Or break out of the loop if it is not. */ - is = int32(int64(zCsr) - int64(pText)) + is = int32(int64(int64(zCsr)) - int64(pText)) v3 = zCsr zCsr++ iCode = uint32(*(*uint8)(unsafe.Pointer(v3))) @@ -215916,12 +216099,12 @@ _2: iCode = uint32(0xFFFD) } } - if _fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 { + if _fts5UnicodeIsAlnum(tls, p, int32(int32(iCode))) != 0 { goto non_ascii_tokenchar } } else { if *(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr))))) != 0 { - is = int32(int64(zCsr) - int64(pText)) + is = int32(int64(int64(zCsr)) - int64(pText)) goto ascii_tokenchar } zCsr++ @@ -215937,13 +216120,13 @@ _6: /* Grow the output buffer so that there is sufficient space to fit the ** largest possible utf-8 character. */ if zOut > pEnd { - aFold = Xsqlite3_malloc64(tls, uint64(int64(nFold)*int64(2))) + aFold = Xsqlite3_malloc64(tls, uint64(int64(int64(nFold))*int64(2))) if aFold == uintptr(0) { rc = int32(SQLITE_NOMEM) goto tokenize_done } - zOut = aFold + uintptr(int64(zOut)-int64((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold)) - libc.Xmemcpy(tls, aFold, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint64(nFold)) + zOut = aFold + uintptr(int64(int64(zOut))-int64((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold)) + libc.Xmemcpy(tls, aFold, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint64(uint64(nFold))) Xsqlite3_free(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = aFold v7 = nFold * libc.Int32FromInt32(2) @@ -215970,12 +216153,13 @@ _6: iCode = uint32(0xFFFD) } } - if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { + if !(_fts5UnicodeIsAlnum(tls, p, int32(int32(iCode))) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(int32(iCode))) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) + iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(int32(iCode)), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) if iCode != 0 { if iCode < uint32(0x00080) { v14 = zOut @@ -216034,6 +216218,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -216050,15 +216235,16 @@ _25: ; _9: ; - ie = int32(int64(zCsr) - int64(pText)) + ie = int32(int64(int64(zCsr)) - int64(pText)) goto _6 _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(int64(zOut))-int64(int64(aFold))), is, ie) goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -216193,7 +216379,7 @@ type TPorterRule1 = struct { type PorterRule1 = TPorterRule1 func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { - return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) + return libc.BoolInt32(int32(int32(c)) == int32('a') || int32(int32(c)) == int32('e') || int32(int32(c)) == int32('i') || int32(int32(c)) == int32('o') || int32(int32(c)) == int32('u') || bYIsVowel != 0 && int32(int32(c)) == int32('y')) } func _fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) (r int32) { @@ -216775,7 +216961,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT if _fts5PorterStep1B(tls, aBuf, bp) != 0 { if _fts5PorterStep1B2(tls, aBuf, bp) == 0 { c = *(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1)))) - if _fts5PorterIsVowel(tls, c, 0) == 0 && int32(c) != int32('l') && int32(c) != int32('s') && int32(c) != int32('z') && int32(c) == int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(2))))) { + if _fts5PorterIsVowel(tls, c, 0) == 0 && int32(int32(c)) != int32('l') && int32(int32(c)) != int32('s') && int32(int32(c)) != int32('z') && int32(int32(c)) == int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(2))))) { *(*int32)(unsafe.Pointer(bp))-- } else { if _fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0 && _fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp))) != 0 { @@ -216805,6 +216991,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) @@ -216946,7 +217133,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int break } for cond := true; cond; cond = iCode == uint32(0) { - aStart[ii] = int32(int64(zIn) - int64(pText)) + aStart[ii] = int32(int64(int64(zIn)) - int64(pText)) v2 = zIn zIn++ iCode = uint32(*(*uint8)(unsafe.Pointer(v2))) @@ -216965,7 +217152,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int return SQLITE_OK } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) + iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(int32(iCode)), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } } if iCode < uint32(0x00080) { @@ -217022,7 +217209,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int for int32(1) != 0 { /* Read characters from the input up until the first non-diacritic */ for cond := true; cond; cond = iCode == uint32(0) { - iNext = int32(int64(zIn) - int64(pText)) + iNext = int32(int64(int64(zIn)) - int64(pText)) v14 = zIn zIn++ iCode = uint32(*(*uint8)(unsafe.Pointer(v14))) @@ -217041,11 +217228,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int break } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { - iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) + iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(int32(iCode)), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(int64(zOut))-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -217059,8 +217246,8 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int z1++ } } - libc.Xmemmove(tls, bp, z1, uint64(int64(zOut)-int64(z1))) - zOut -= uintptr(int64(z1) - t__predefined_ptrdiff_t(bp)) + libc.Xmemmove(tls, bp, z1, uint64(int64(int64(zOut))-int64(int64(z1)))) + zOut -= uintptr(int64(int64(z1)) - t__predefined_ptrdiff_t(bp)) if iCode < uint32(0x00080) { v17 = zOut zOut++ @@ -217492,7 +217679,7 @@ func _fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) (r int32) { 124: uint8(libc.Int32FromUint8('u') | int32(libc.Uint8FromInt32(0x80))), 125: uint8('y'), } - key = uint32(c)< iLo { iTest = (iHi + iLo) / int32(2) - if int32(iKey) >= int32(_aFts5UnicodeMap[iTest]) { + if int32(int32(iKey)) >= int32(_aFts5UnicodeMap[iTest]) { iRes = iTest iLo = iTest + int32(1) } else { @@ -222220,14 +222407,14 @@ func _sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode Tu32) (r int32) { if iRes < 0 { return 0 } - if int32(iKey) >= int32(_aFts5UnicodeMap[iRes])+int32(_aFts5UnicodeData[iRes])>>int32(5) { + if int32(int32(iKey)) >= int32(_aFts5UnicodeMap[iRes])+int32(_aFts5UnicodeData[iRes])>>int32(5) { return 0 } ret = int32(_aFts5UnicodeData[iRes]) & int32(0x1F) if ret != int32(30) { return ret } - if (int32(iKey)-int32(_aFts5UnicodeMap[iRes]))&int32(0x01) != 0 { + if (int32(int32(iKey))-int32(_aFts5UnicodeMap[iRes]))&int32(0x01) != 0 { v1 = int32(5) } else { v1 = int32(9) @@ -222247,7 +222434,7 @@ func _sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { if !(i < int32(128) && i < n) { break } - *(*Tu8)(unsafe.Pointer(aAscii + uintptr(i))) = uint8(bToken) + *(*Tu8)(unsafe.Pointer(aAscii + uintptr(i))) = uint8(uint8(bToken)) goto _1 _1: ; @@ -222333,7 +222520,7 @@ func _sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) (r int32) { p -= uintptr(2) n = _sqlite3Fts5GetVarint(tls, p, bp) *(*Tu32)(unsafe.Pointer(v)) = uint32(*(*Tu64)(unsafe.Pointer(bp))) & uint32(0x7FFFFFFF) - return int32(n) + return int32(int32(n)) return r } @@ -222359,7 +222546,7 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { a = uint32(*(*uint8)(unsafe.Pointer(p))) /* a: p0 (unmasked) */ if !(a&libc.Uint32FromInt32(0x80) != 0) { - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(1) } p++ @@ -222369,7 +222556,7 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { a &= uint32(0x7f) a = a << int32(7) a |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(2) } /* Verify that constants are precomputed correctly */ @@ -222382,7 +222569,7 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { b &= uint32(0x7f) b = b << int32(7) a |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(3) } /* CSE1 from below */ @@ -222397,7 +222584,7 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { /* a &= (0x7f<<14)|(0x7f); */ a = a << int32(7) a |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(a) + *(*Tu64)(unsafe.Pointer(v)) = uint64(uint64(a)) return uint8(4) } /* a: p0<<14 | p2 (masked) */ @@ -222419,7 +222606,7 @@ func _sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) (r Tu8) { b = b << int32(7) a |= b s = s >> int32(18) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(18) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(11) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(4) - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<> int32(3) s |= b - *(*Tu64)(unsafe.Pointer(v)) = uint64(s)<>= uint64(8) i = int32(7) for { @@ -222833,16 +223020,16 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = int32(uint64(64) + uint64(nDb) + uint64(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = int32(uint64(64) + uint64(uint64(nDb)) + uint64(uint64(nTab))) + pRet = _sqlite3Fts5MallocZero(tls, bp, int64(int64(nByte))) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint64(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint64(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint64(uint64(nTab))) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint64(uint64(nDb))) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -223069,7 +223256,7 @@ func _fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) (r int32) { v1 = (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm } nCmp = v1 - bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp)) + bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(uint64(nCmp))) if bCmp < 0 || bCmp == 0 && (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp + 4)) { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = int32(1) } @@ -223159,15 +223346,15 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { v2 = (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm } nCmp = v2 - bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp)) + bCmp = libc.Xmemcmp(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(uint64(nCmp))) if bCmp < 0 || bCmp == 0 && (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp + 4)) { (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = int32(1) return SQLITE_OK } } _sqlite3Fts5BufferSet(tls, bp, pCsr+96, *(*int32)(unsafe.Pointer(bp + 4)), zTerm) - libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, uint64(nCol)*uint64(8)) - libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, uint64(nCol)*uint64(8)) + libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, uint64(uint64(nCol))*uint64(8)) + libc.Xmemset(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, uint64(uint64(nCol))*uint64(8)) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol = 0 for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { eDetail = (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail /* Position list */ @@ -223201,7 +223388,7 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { } else { if eDetail == int32(FTS5_DETAIL_COLUMNS) { for 0 == _sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+16, bp+8) { - if *(*Ti64)(unsafe.Pointer(bp + 8)) >= int64(nCol) { + if *(*Ti64)(unsafe.Pointer(bp + 8)) >= int64(int64(nCol)) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { @@ -21137,6 +21138,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -22123,6 +22125,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -22230,6 +22233,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -26118,6 +26122,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26249,6 +26254,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27753,6 +27759,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27899,6 +27906,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -29115,6 +29123,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30942,6 +30951,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -31214,6 +31224,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if (*TBitvec)(unsafe.Pointer(p)).FnSet >= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)/libc.Uint32FromInt32(2) { @@ -31242,6 +31253,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31475,6 +31487,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32765,7 +32778,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+52) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33315,7 +33328,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+52, int32(1)) return SQLITE_OK } @@ -36907,6 +36920,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -37243,6 +37257,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -39246,6 +39261,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39669,6 +39685,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+28) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39846,6 +39863,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40794,6 +40812,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -43291,6 +43310,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43338,6 +43358,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -53028,6 +53058,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53194,6 +53225,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53343,6 +53375,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53959,6 +53992,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -54117,6 +54151,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -55199,6 +55234,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int32(*(*uintptr)(unsafe.Pointer(bp))) - int32(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56322,6 +56358,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell) @@ -57043,6 +57080,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57643,6 +57681,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58516,6 +58555,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4761, libc.VaList(bp+48, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58684,6 +58724,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59847,6 +59888,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61414,6 +61456,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61589,6 +61632,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -62285,6 +62329,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62673,6 +62718,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 20 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -66231,6 +66277,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66402,6 +66449,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67466,6 +67514,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67569,6 +67618,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67958,6 +68008,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68346,6 +68397,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -69083,6 +69135,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -69234,6 +69287,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70588,6 +70642,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*20 @@ -70601,6 +70656,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+312, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70694,6 +70750,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71342,6 +71399,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71394,6 +71452,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71433,6 +71492,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72345,6 +72405,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72484,6 +72545,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72626,9 +72688,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72741,6 +72805,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5666, libc.VaList(bp+736, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) @@ -73783,6 +73848,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -74275,6 +74341,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 96)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 36))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74389,6 +74456,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 136)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74716,6 +74784,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) @@ -75587,6 +75656,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 36)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77897,6 +77967,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77929,6 +78000,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77948,6 +78020,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5423, 0) @@ -77955,6 +78028,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77964,6 +78038,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78369,6 +78444,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+4) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83453,6 +83529,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 56)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87428,6 +87505,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89468,11 +89546,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -90022,6 +90102,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -91203,6 +91284,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91424,6 +91506,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92406,6 +92489,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -93025,6 +93109,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9919, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93287,6 +93372,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 44))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93405,6 +93491,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9919, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94553,6 +94640,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -95072,6 +95160,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11246, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -95240,6 +95329,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -96022,6 +96112,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint32(8)*uint32(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97817,6 +97908,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97898,6 +97990,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97954,6 +98047,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -100088,6 +100182,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100653,6 +100748,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100804,9 +100900,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -102019,6 +102117,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102577,6 +102676,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102745,6 +102845,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 44))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103543,6 +103644,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103734,6 +103836,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -104209,6 +104312,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -106285,6 +106389,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15209) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106965,11 +107070,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -108291,10 +108398,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -139276,6 +139405,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141842,6 +141972,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142741,6 +142872,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -148384,6 +148516,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148976,6 +149109,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22556, -int32(1)) @@ -150223,6 +150357,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165424,8 +165559,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165438,7 +165571,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165498,7 +165631,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint32(92)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165514,7 +165647,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165540,7 +165673,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165555,10 +165688,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165606,7 +165739,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+208) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -172237,6 +172375,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172896,6 +173035,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -173051,6 +173191,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -173178,6 +173319,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -173295,6 +173437,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -173376,6 +173519,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173434,6 +173578,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173978,6 +174123,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 25 @@ -174824,6 +174970,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174946,10 +175093,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24936, -int32(1)) @@ -175160,6 +175309,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -175249,6 +175399,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(56)) @@ -175339,6 +175490,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -175349,6 +175501,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24936, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175688,6 +175841,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -176058,9 +176212,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -176170,6 +176326,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -177269,6 +177426,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180622,6 +180780,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -181232,6 +181391,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181780,6 +181940,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182770,6 +182931,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -183278,6 +183440,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(40)+libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2)*uint32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) @@ -183381,8 +183544,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint32FromInt64(4)*libc.Uint32FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -184015,6 +184178,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -184155,6 +184319,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -184308,6 +184473,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 4)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184593,6 +184759,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186742,6 +186909,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -187187,6 +187355,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191764,6 +191933,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191854,6 +192024,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -194352,6 +194523,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194847,6 +195019,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -197000,6 +197173,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf) @@ -204634,6 +204808,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204766,6 +204941,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204981,6 +205157,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210636,6 +210813,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -211012,6 +211190,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -211043,6 +211222,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -212296,6 +212476,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -212521,6 +212702,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218811,6 +218993,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222600,6 +222783,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222661,6 +222845,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222686,6 +222871,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -223435,6 +223621,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go index 19810c104d..6bd0531a3f 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go @@ -1,4 +1,4 @@ -// Code generated for linux/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && arm64 // +build linux,arm64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -14110,6 +14108,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -14178,6 +14177,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x01) != 0 { @@ -19216,6 +19216,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20988,6 +20989,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21974,6 +21976,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -22081,6 +22084,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25946,6 +25950,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26077,6 +26082,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27581,6 +27587,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27727,6 +27734,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28943,6 +28951,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30765,6 +30774,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -31037,6 +31047,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -31065,6 +31076,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31298,6 +31310,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32586,7 +32599,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33136,7 +33149,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -36719,6 +36732,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -37055,6 +37069,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -39058,6 +39073,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39481,6 +39497,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39658,6 +39675,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40606,6 +40624,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -43102,6 +43121,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43149,6 +43169,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -52831,6 +52861,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -52997,6 +53028,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53146,6 +53178,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53762,6 +53795,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -53920,6 +53954,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -55002,6 +55037,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56125,6 +56161,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -56846,6 +56883,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57446,6 +57484,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58319,6 +58358,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4761, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58487,6 +58527,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59650,6 +59691,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61217,6 +61259,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61392,6 +61435,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -62088,6 +62132,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62476,6 +62521,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -66032,6 +66078,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66203,6 +66250,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67267,6 +67315,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67370,6 +67419,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67759,6 +67809,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68147,6 +68198,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -68884,6 +68936,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -69035,6 +69088,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70389,6 +70443,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -70402,6 +70457,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70495,6 +70551,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71143,6 +71200,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71195,6 +71253,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71234,6 +71293,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72146,6 +72206,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72285,6 +72346,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72427,9 +72489,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72542,6 +72606,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5666, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -73584,6 +73649,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -74076,6 +74142,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74190,6 +74257,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74517,6 +74585,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -75388,6 +75457,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77698,6 +77768,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77730,6 +77801,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77749,6 +77821,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5423, 0) @@ -77756,6 +77829,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77765,6 +77839,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78170,6 +78245,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83217,6 +83293,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87192,6 +87269,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89232,11 +89310,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -89786,6 +89866,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -90967,6 +91048,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91188,6 +91270,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92168,6 +92251,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -92787,6 +92871,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9919, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93049,6 +93134,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93167,6 +93253,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9919, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94315,6 +94402,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -94834,6 +94922,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11246, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -95002,6 +95091,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -95772,6 +95862,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97567,6 +97658,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97648,6 +97740,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97704,6 +97797,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -99838,6 +99932,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100403,6 +100498,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100554,9 +100650,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -101769,6 +101867,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102327,6 +102426,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102495,6 +102595,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103293,6 +103394,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103484,6 +103586,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103959,6 +104062,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -106035,6 +106139,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15209) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106715,11 +106820,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -108041,10 +108148,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138983,6 +139112,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141549,6 +141679,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142448,6 +142579,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -148091,6 +148223,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148680,6 +148813,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22556, -int32(1)) @@ -149926,6 +150060,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165127,8 +165262,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165141,7 +165274,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165201,7 +165334,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165217,7 +165350,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165243,7 +165376,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165258,10 +165391,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165309,7 +165442,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171936,6 +172074,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172595,6 +172734,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -172750,6 +172890,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172877,6 +173018,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -172994,6 +173136,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -173075,6 +173218,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173133,6 +173277,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173677,6 +173822,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -174523,6 +174669,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174645,10 +174792,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24936, -int32(1)) @@ -174859,6 +175008,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174948,6 +175098,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -175038,6 +175189,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -175048,6 +175200,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24936, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175387,6 +175540,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175757,9 +175911,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175869,6 +176025,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176964,6 +177121,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180291,6 +180449,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180901,6 +181060,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181449,6 +181609,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182439,6 +182600,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182947,6 +183109,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -183050,8 +183213,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183678,6 +183841,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183818,6 +183982,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183971,6 +184136,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184256,6 +184422,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186394,6 +186561,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186839,6 +187007,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191414,6 +191583,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191504,6 +191674,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -194002,6 +194173,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194497,6 +194669,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196650,6 +196823,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -204255,6 +204429,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204387,6 +204562,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204594,6 +204770,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210192,6 +210369,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -210568,6 +210746,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -210599,6 +210778,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211853,6 +212033,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -212078,6 +212259,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218346,6 +218528,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222131,6 +222314,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222192,6 +222376,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222217,6 +222402,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -222966,6 +223152,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go index ed15248f64..27937ebdde 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go @@ -1,4 +1,4 @@ -// Code generated for linux/loong64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/loong64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && loong64 // +build linux,loong64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -3487,7 +3485,7 @@ const __UTA_FBIT__ = 64 const __UTA_IBIT__ = 64 const __UTQ_FBIT__ = 128 const __UTQ_IBIT__ = 0 -const __VERSION__ = "14.0.1 20240228 (Red Hat 14.0.1-0)" +const __VERSION__ = "14.0.1 20240411 (Red Hat 14.0.1-0)" const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_TYPE__ = 0 @@ -13690,6 +13688,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -13758,6 +13757,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -19022,6 +19022,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20779,6 +20780,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21654,6 +21656,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -21759,6 +21762,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25358,6 +25362,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -25481,6 +25486,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26943,6 +26949,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27084,6 +27091,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28242,6 +28250,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags ctrlFlags |= int32(UNIXFILE_URI) } rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -29999,6 +30008,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -30267,6 +30277,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -30295,6 +30306,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -30527,6 +30539,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -31766,7 +31779,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -32287,7 +32300,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -35784,6 +35797,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -36111,6 +36125,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -38036,6 +38051,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -38433,6 +38449,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -38598,6 +38615,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -39480,6 +39498,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -41880,6 +41899,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -41926,6 +41946,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -51104,6 +51134,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51262,6 +51293,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -51397,6 +51429,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -51988,6 +52021,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52140,6 +52174,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -53152,6 +53187,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -54215,6 +54251,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -54899,6 +54936,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -55471,6 +55509,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -56319,6 +56358,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4793, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -56483,6 +56523,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -57601,6 +57642,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -59040,6 +59082,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -59206,6 +59249,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -59881,6 +59925,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -60256,6 +60301,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -63673,6 +63719,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -63838,6 +63885,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -64855,6 +64903,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -64952,6 +65001,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -65327,6 +65377,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -65709,6 +65760,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -66435,6 +66487,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -66584,6 +66637,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -67908,6 +67962,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -67921,6 +67976,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -68007,6 +68063,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -68618,6 +68675,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -68670,6 +68728,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -68709,6 +68768,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -69576,6 +69636,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -69702,6 +69763,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -69839,9 +69901,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -69948,6 +70012,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5698, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -70911,6 +70976,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -71347,6 +71413,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -71452,6 +71519,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -71762,6 +71830,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -72529,6 +72598,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -74649,6 +74719,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -74680,6 +74751,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -74698,6 +74770,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5455, 0) @@ -74705,6 +74778,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -74714,6 +74788,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -75109,6 +75184,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -80026,6 +80102,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -83821,6 +83898,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -85797,11 +85875,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -86325,6 +86405,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -87408,6 +87489,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -87613,6 +87695,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -88568,6 +88651,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -89168,6 +89252,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9951, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89410,6 +89495,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -89526,6 +89612,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9951, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -90663,6 +90750,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -91178,6 +91266,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11278, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -91342,6 +91431,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -92094,6 +92184,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -93844,6 +93935,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -93924,6 +94016,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -93978,6 +94071,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -96055,6 +96149,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -96613,6 +96708,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -96761,9 +96857,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -97934,6 +98032,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -98474,6 +98573,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -98637,6 +98737,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -99401,6 +99502,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -99586,6 +99688,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -100044,6 +100147,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -102047,6 +102151,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15241) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -102709,11 +102814,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -104017,10 +104124,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -134114,6 +134243,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -136580,6 +136710,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -137455,6 +137586,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -142942,6 +143074,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -143522,6 +143655,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22588, -int32(1)) @@ -144747,6 +144881,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -159846,8 +159981,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -159859,7 +159992,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { _sqlite3MemoryBarrier(tls) return SQLITE_OK } @@ -159920,7 +160053,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -159937,7 +160070,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) _sqlite3MemoryBarrier(tls) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -159962,7 +160095,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -159977,10 +160110,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -160028,7 +160161,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -166567,6 +166705,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -167219,6 +167358,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -167373,6 +167513,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -167499,6 +167640,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -167616,6 +167758,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -167693,6 +167836,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -167751,6 +167895,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -168287,6 +168432,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -169123,6 +169269,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -169241,10 +169388,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24968, -int32(1)) @@ -169454,6 +169603,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -169542,6 +169692,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -169631,6 +169782,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -169641,6 +169793,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24968, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -169979,6 +170132,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -170346,9 +170500,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -170458,6 +170614,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -171546,6 +171703,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -174837,6 +174995,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -175442,6 +175601,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -175990,6 +176150,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -176974,6 +177135,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -177481,6 +177643,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -177584,8 +177747,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -178212,6 +178375,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -178352,6 +178516,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -178500,6 +178665,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -178782,6 +178948,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -180914,6 +181081,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -181353,6 +181521,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -185858,6 +186027,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -185948,6 +186118,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -188418,6 +188589,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -188906,6 +189078,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -191035,6 +191208,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -198535,6 +198709,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -198667,6 +198842,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -198873,6 +199049,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -204376,6 +204553,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -204738,6 +204916,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -204769,6 +204948,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -205973,6 +206153,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -206190,6 +206371,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -212316,6 +212498,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -216061,6 +216244,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -216122,6 +216306,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -216147,6 +216332,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -216893,6 +217079,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) @@ -223850,7 +224037,7 @@ var Xsqlite3_version = [7]int8{'3', '.', '4', '5', '.', '3'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.0.1 20240228 (Red Hat 14.0.1-0)\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%04d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00(subquery-%u)\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00PRAGMA \"%w\".integrity_check(%Q)\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00ceiling\x00floor\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00RIGHT PART OF \x00USE TEMP B-TREE FOR %sORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00bad JSON path: %Q\x00@\x00[\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00'delete' may not be used with a contentless_delete=1 table\x00DELETE from\x00cannot %s contentless fts5 table: %s\x00no such cursor: %lld\x00cannot UPDATE a subset of columns on fts5 contentless-delete table: %s\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.0.1 20240411 (Red Hat 14.0.1-0)\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%04d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00(subquery-%u)\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00PRAGMA \"%w\".integrity_check(%Q)\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00ceiling\x00floor\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00RIGHT PART OF \x00USE TEMP B-TREE FOR %sORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00bad JSON path: %Q\x00@\x00[\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00'delete' may not be used with a contentless_delete=1 table\x00DELETE from\x00cannot %s contentless fts5 table: %s\x00no such cursor: %lld\x00cannot UPDATE a subset of columns on fts5 contentless-delete table: %s\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go index 9735f670f3..0096c7bb30 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go @@ -1,4 +1,4 @@ -// Code generated for linux/ppc64le by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/ppc64le by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && ppc64le // +build linux,ppc64le @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -14105,6 +14103,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -14173,6 +14172,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x01) != 0 { @@ -19211,6 +19211,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20983,6 +20984,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21967,6 +21969,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -22074,6 +22077,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25939,6 +25943,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26070,6 +26075,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27574,6 +27580,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27720,6 +27727,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28936,6 +28944,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30746,6 +30755,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -31018,6 +31028,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -31046,6 +31057,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31279,6 +31291,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32567,7 +32580,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33117,7 +33130,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -36700,6 +36713,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -37036,6 +37050,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -39039,6 +39054,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39462,6 +39478,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39639,6 +39656,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40587,6 +40605,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -43083,6 +43102,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43130,6 +43150,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -52812,6 +52842,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -52978,6 +53009,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53127,6 +53159,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53743,6 +53776,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -53901,6 +53935,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -54983,6 +55018,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56106,6 +56142,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -56827,6 +56864,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57427,6 +57465,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58300,6 +58339,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58468,6 +58508,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59631,6 +59672,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61198,6 +61240,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61373,6 +61416,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -62069,6 +62113,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62457,6 +62502,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -66013,6 +66059,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66184,6 +66231,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67248,6 +67296,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67351,6 +67400,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67740,6 +67790,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68128,6 +68179,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -68865,6 +68917,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -69016,6 +69069,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70370,6 +70424,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -70383,6 +70438,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70476,6 +70532,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71124,6 +71181,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71176,6 +71234,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71215,6 +71274,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72127,6 +72187,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72266,6 +72327,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72408,9 +72470,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72523,6 +72587,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5675, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -73565,6 +73630,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -74057,6 +74123,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74171,6 +74238,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74498,6 +74566,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -75369,6 +75438,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77679,6 +77749,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77711,6 +77782,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77730,6 +77802,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5432, 0) @@ -77737,6 +77810,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77746,6 +77820,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78151,6 +78226,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83198,6 +83274,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87173,6 +87250,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89213,11 +89291,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -89767,6 +89847,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -90948,6 +91029,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91169,6 +91251,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92149,6 +92232,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -92768,6 +92852,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9928, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93030,6 +93115,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93148,6 +93234,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9928, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94296,6 +94383,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -94815,6 +94903,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11255, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -94983,6 +95072,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -95753,6 +95843,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97548,6 +97639,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97629,6 +97721,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97685,6 +97778,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -99819,6 +99913,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100384,6 +100479,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100535,9 +100631,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13068, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -101750,6 +101848,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102308,6 +102407,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102476,6 +102576,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103274,6 +103375,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103465,6 +103567,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103940,6 +104043,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -106016,6 +106120,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15218) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106696,11 +106801,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -108022,10 +108129,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138964,6 +139093,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141530,6 +141660,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142429,6 +142560,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -148072,6 +148204,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148661,6 +148794,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22565, -int32(1)) @@ -149907,6 +150041,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165108,8 +165243,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165122,7 +165255,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165182,7 +165315,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165198,7 +165331,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165224,7 +165357,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165239,10 +165372,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165290,7 +165423,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171917,6 +172055,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172576,6 +172715,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -172731,6 +172871,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172858,6 +172999,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -172975,6 +173117,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -173056,6 +173199,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173114,6 +173258,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173658,6 +173803,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -174504,6 +174650,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174626,10 +174773,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24945, -int32(1)) @@ -174840,6 +174989,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174929,6 +175079,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -175019,6 +175170,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -175029,6 +175181,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24945, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175368,6 +175521,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175738,9 +175892,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175850,6 +176006,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176945,6 +177102,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180272,6 +180430,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180882,6 +181041,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181430,6 +181590,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182420,6 +182581,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182928,6 +183090,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -183031,8 +183194,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183659,6 +183822,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183799,6 +183963,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183952,6 +184117,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184237,6 +184403,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186375,6 +186542,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186820,6 +186988,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191395,6 +191564,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191485,6 +191655,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193983,6 +194154,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194478,6 +194650,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196631,6 +196804,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -204236,6 +204410,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204368,6 +204543,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204575,6 +204751,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210173,6 +210350,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -210549,6 +210727,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -210580,6 +210759,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211834,6 +212014,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -212059,6 +212240,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218327,6 +218509,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222112,6 +222295,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222173,6 +222357,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222198,6 +222383,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -222947,6 +223133,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go index 5cdde0ba65..7e86d8043d 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go @@ -1,4 +1,4 @@ -// Code generated for linux/riscv64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/riscv64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && riscv64 // +build linux,riscv64 @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -14068,6 +14066,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -14136,6 +14135,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x01) != 0 { @@ -19174,6 +19174,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20946,6 +20947,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21930,6 +21932,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -22037,6 +22040,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25902,6 +25906,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -26033,6 +26038,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27537,6 +27543,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27683,6 +27690,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28899,6 +28907,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30709,6 +30718,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -30981,6 +30991,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -31009,6 +31020,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31242,6 +31254,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32530,7 +32543,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33080,7 +33093,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -36663,6 +36676,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -36999,6 +37013,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -39002,6 +39017,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39425,6 +39441,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39602,6 +39619,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40550,6 +40568,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -43046,6 +43065,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43093,6 +43113,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -52775,6 +52805,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -52941,6 +52972,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53090,6 +53122,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53706,6 +53739,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -53864,6 +53898,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -54946,6 +54981,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56069,6 +56105,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -56790,6 +56827,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57390,6 +57428,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58263,6 +58302,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4761, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58431,6 +58471,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59594,6 +59635,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61161,6 +61203,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61336,6 +61379,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -62032,6 +62076,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62420,6 +62465,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -65976,6 +66022,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66147,6 +66194,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67211,6 +67259,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67314,6 +67363,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67703,6 +67753,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68091,6 +68142,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -68828,6 +68880,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -68979,6 +69032,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70333,6 +70387,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -70346,6 +70401,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70439,6 +70495,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71087,6 +71144,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71139,6 +71197,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71178,6 +71237,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72090,6 +72150,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72229,6 +72290,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72371,9 +72433,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72486,6 +72550,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5666, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -73528,6 +73593,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -74020,6 +74086,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74134,6 +74201,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74461,6 +74529,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -75332,6 +75401,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77642,6 +77712,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77674,6 +77745,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77693,6 +77765,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5423, 0) @@ -77700,6 +77773,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77709,6 +77783,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78114,6 +78189,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83161,6 +83237,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87136,6 +87213,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89176,11 +89254,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -89730,6 +89810,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -90911,6 +90992,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91132,6 +91214,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92112,6 +92195,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -92731,6 +92815,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9919, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -92993,6 +93078,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93111,6 +93197,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9919, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94259,6 +94346,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -94778,6 +94866,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11246, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -94946,6 +95035,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -95716,6 +95806,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97511,6 +97602,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97592,6 +97684,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97648,6 +97741,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -99782,6 +99876,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100347,6 +100442,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100498,9 +100594,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -101713,6 +101811,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102271,6 +102370,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102439,6 +102539,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103237,6 +103338,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103428,6 +103530,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103903,6 +104006,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -105979,6 +106083,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15209) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106659,11 +106764,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -107985,10 +108092,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138927,6 +139056,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141493,6 +141623,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142392,6 +142523,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -148035,6 +148167,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148624,6 +148757,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22556, -int32(1)) @@ -149870,6 +150004,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165071,8 +165206,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165085,7 +165218,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165145,7 +165278,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165161,7 +165294,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165187,7 +165320,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165202,10 +165335,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165253,7 +165386,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171880,6 +172018,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172539,6 +172678,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -172694,6 +172834,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172821,6 +172962,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -172938,6 +173080,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -173019,6 +173162,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173077,6 +173221,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173621,6 +173766,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -174467,6 +174613,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174589,10 +174736,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24936, -int32(1)) @@ -174803,6 +174952,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174892,6 +175042,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -174982,6 +175133,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -174992,6 +175144,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24936, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175331,6 +175484,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175701,9 +175855,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175813,6 +175969,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176908,6 +177065,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180235,6 +180393,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180845,6 +181004,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181393,6 +181553,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182383,6 +182544,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182891,6 +183053,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -182994,8 +183157,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183622,6 +183785,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183762,6 +183926,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183915,6 +184080,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184200,6 +184366,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186338,6 +186505,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186783,6 +186951,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191358,6 +191527,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191448,6 +191618,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193946,6 +194117,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194441,6 +194613,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196594,6 +196767,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -204199,6 +204373,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204331,6 +204506,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204538,6 +204714,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210136,6 +210313,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -210512,6 +210690,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -210543,6 +210722,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211797,6 +211977,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -212022,6 +212203,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218290,6 +218472,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222075,6 +222258,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222136,6 +222320,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222161,6 +222346,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -222910,6 +223096,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go index ca700f3b37..33c65371db 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go @@ -1,4 +1,4 @@ -// Code generated for linux/s390x by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/s390x by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && s390x // +build linux,s390x @@ -10,8 +10,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -14002,6 +14000,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -14070,6 +14069,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x01) != 0 { @@ -19108,6 +19108,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -20880,6 +20881,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -21870,6 +21872,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -21977,6 +21980,7 @@ do_atof_calc: *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } _ = libc.Int32FromInt32(0) + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -25837,6 +25841,7 @@ func _unixLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { (*TunixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock) (*TunixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(eFileLock) } + goto end_lock end_lock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -25968,6 +25973,7 @@ func _posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock in _closePendingFds(tls, pFile) } } + goto end_unlock end_unlock: ; Xsqlite3_mutex_leave(tls, (*TunixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) @@ -27472,6 +27478,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _unixShmPurge(tls, pDbFd) /* This call frees pShmNode if required */ @@ -27618,6 +27625,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) + nShmPerMap) } } + goto shmpage_out shmpage_out: ; if int32((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion) > iRegion { @@ -28834,6 +28842,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } _ = libc.Int32FromInt32(0) rc = _fillInUnixFile(tls, pVfs, fd, pFile, zPath, ctrlFlags) + goto open_finished open_finished: ; if rc != SQLITE_OK { @@ -30644,6 +30653,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -30916,6 +30926,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -30944,6 +30955,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -31177,6 +31189,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -32465,7 +32478,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -33015,7 +33028,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -36598,6 +36611,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -36934,6 +36948,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } /*NOTREACHED*/ _ = libc.Int32FromInt32(0) + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -38937,6 +38952,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -39360,6 +39376,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -39537,6 +39554,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; _ = libc.Int32FromInt32(0) @@ -40485,6 +40503,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -42981,6 +43000,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -43028,6 +43048,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -52710,6 +52740,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -52876,6 +52907,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; _ = libc.Int32FromInt32(0) @@ -53025,6 +53057,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -53641,6 +53674,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } } _ = libc.Int32FromInt32(0) + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -53799,6 +53833,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -54881,6 +54916,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(aData)) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -56004,6 +56040,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -56725,6 +56762,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s } } _ = libc.Int32FromInt32(0) + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -57325,6 +57363,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -58198,6 +58237,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -58366,6 +58406,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -59529,6 +59570,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } _ = libc.Int32FromInt32(0) + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -61096,6 +61138,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -61271,6 +61314,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -61967,6 +62011,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -62355,6 +62400,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { _ = libc.Int32FromInt32(0) pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -65911,6 +65957,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -66082,6 +66129,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -67146,6 +67194,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -67249,6 +67298,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -67638,6 +67688,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -68026,6 +68077,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -68763,6 +68815,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -68914,6 +68967,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -70268,6 +70322,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -70281,6 +70336,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -70374,6 +70430,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; _ = libc.Int32FromInt32(0) /* There are never any jumps to instruction 0 */ @@ -71022,6 +71079,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(type1)&int32(type2)&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -71074,6 +71132,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(type1)&int32(type2)&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -71113,6 +71172,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -72025,6 +72085,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; _ = libc.Int32FromInt32(0) @@ -72164,6 +72225,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -72306,9 +72368,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -72421,6 +72485,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } _ = libc.Int32FromInt32(0) goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5675, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -73463,6 +73528,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _ = libc.Int32FromInt32(0) @@ -73955,6 +74021,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; _ = libc.Int32FromInt32(0) @@ -74069,6 +74136,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -74396,6 +74464,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -75267,6 +75336,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -77577,6 +77647,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -77609,6 +77680,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -77628,6 +77700,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+5432, 0) @@ -77635,6 +77708,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -77644,6 +77718,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; _ = libc.Int32FromInt32(0) @@ -78049,6 +78124,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83096,6 +83172,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(eNewExprOp) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -87071,6 +87148,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -89111,11 +89189,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -89665,6 +89745,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target p5 = 0 _ = libc.Int32FromInt32(0) _ = libc.Int32FromInt32(0) + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -90846,6 +90927,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -91067,6 +91149,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -92047,6 +92130,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; _ = libc.Int32FromInt32(0) @@ -92666,6 +92750,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+9928, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -92928,6 +93013,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset _ = libc.Int32FromInt32(0) + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -93046,6 +93132,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+9928, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -94194,6 +94281,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } _ = libc.Int32FromInt32(0) rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -94713,6 +94801,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11255, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -94881,6 +94970,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -95651,6 +95741,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(nEqZero)) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -97446,6 +97537,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -97527,6 +97619,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -97583,6 +97676,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -99717,6 +99811,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -100282,6 +100377,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -100433,9 +100529,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13068, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -101648,6 +101746,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -102206,6 +102305,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -102374,6 +102474,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -103172,6 +103273,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -103363,6 +103465,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -103838,6 +103941,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _ = libc.Int32FromInt32(0) @@ -105914,6 +106018,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15218) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -106594,11 +106699,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -107920,10 +108027,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(c)))<flags */ @@ -138862,6 +138991,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -141428,6 +141558,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -142327,6 +142458,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -147970,6 +148102,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -148559,6 +148692,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22565, -int32(1)) @@ -149805,6 +149939,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -165006,8 +165141,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { - ng := runtime.GOMAXPROCS(1) - defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -165020,7 +165153,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { return SQLITE_OK } /* Make sure the mutex subsystem is initialized. If unable to @@ -165080,7 +165213,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -165096,7 +165229,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { } if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -165122,7 +165255,7 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -165137,10 +165270,10 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -165188,7 +165321,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -171815,6 +171953,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -172474,6 +172613,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) { @@ -172629,6 +172769,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -172756,6 +172897,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -172873,6 +173015,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -172954,6 +173097,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -173012,6 +173156,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; _ = libc.Int32FromInt32(0) @@ -173556,6 +173701,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -174402,6 +174548,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -174524,10 +174671,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24945, -int32(1)) @@ -174738,6 +174887,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -174827,6 +174977,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -174917,6 +175068,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -174927,6 +175079,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+24945, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -175266,6 +175419,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -175636,9 +175790,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -175748,6 +175904,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -176843,6 +177000,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -180169,6 +180327,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -180779,6 +180938,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -181327,6 +181487,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -182317,6 +182478,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -182825,6 +182987,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -182928,8 +183091,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -183556,6 +183719,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -183696,6 +183860,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -183849,6 +184014,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -184134,6 +184300,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -186272,6 +186439,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -186717,6 +186885,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -191292,6 +191461,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -191382,6 +191552,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -193880,6 +194051,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -194375,6 +194547,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -196528,6 +196701,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -204133,6 +204307,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -204265,6 +204440,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -204472,6 +204648,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -210070,6 +210247,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -210446,6 +210624,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -210477,6 +210656,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(n) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -211731,6 +211911,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -211956,6 +212137,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; _ = libc.Int32FromInt32(0) @@ -218224,6 +218406,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -222009,6 +222192,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(iCode), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -222070,6 +222254,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -222095,6 +222280,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -222844,6 +223030,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modernc.org/sqlite/lib/sqlite_windows.go b/vendor/modernc.org/sqlite/lib/sqlite_windows.go index d2ec112245..15f94022e4 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_windows.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_windows.go @@ -1,4 +1,4 @@ -// Code generated for windows/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -import runtime -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo --cpp /usr/bin/x86_64-w64-mingw32-gcc --goarch amd64 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -build-lines \/\/go:build windows && (amd64 || arm64)\n\/\/ \x2bbuild windows\n\/\/ \x2bbuild amd64 arm64 -map gcc=x86_64-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. +// Code generated for windows/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -Dpread64=pread -Dpwrite64=pwrite -extended-errors -o sqlite3.go sqlite3.c -I/tmp/libsqlite3/sqlite-amalgamation-3450300/ccgo --cpp /usr/bin/x86_64-w64-mingw32-gcc --goarch amd64 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -build-lines \/\/go:build windows && (amd64 || arm64)\n\/\/ \x2bbuild windows\n\/\/ \x2bbuild amd64 arm64 -map gcc=x86_64-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. //go:build windows && (amd64 || arm64) // +build windows @@ -11,8 +11,6 @@ import ( "unsafe" "modernc.org/libc" - - "runtime" ) var ( @@ -26327,10 +26325,10 @@ type fpos_t = Tfpos_t * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ -func _vswprintf(tls *libc.TLS, __stream uintptr, __count Tsize_t, __format uintptr, __local_argv t__builtin_va_list) (r int32) { +func _vswprintf(tls *libc.TLS, __stream1 uintptr, __count Tsize_t, __format1 uintptr, __local_argv1 t__builtin_va_list) (r int32) { var v1 int32 _ = v1 - v1 = libc.X__mingw_vsnwprintf(tls, __stream, __count, __format, __local_argv) + v1 = libc.X__mingw_vsnwprintf(tls, __stream1, __count, __format1, __local_argv1) goto _2 _2: return v1 @@ -32851,6 +32849,7 @@ func _getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) (r in cnt++ zFormat += uintptr(4) } + goto end_getDigits end_getDigits: ; _ = ap @@ -32919,6 +32918,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } zDate += uintptr(5) (*TDateTime)(unsafe.Pointer(p)).Ftz = sgn * (*(*int32)(unsafe.Pointer(bp + 4)) + *(*int32)(unsafe.Pointer(bp))*int32(60)) + goto zulu_time zulu_time: ; for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x01) != 0 { @@ -94989,6 +94989,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } else { length = int32(0x7fffffff) & int32(libc.Xstrlen(tls, bufpt)) } + goto adjust_width_for_utf8 adjust_width_for_utf8: ; if flag_altform2 != 0 && width > 0 { @@ -96801,6 +96802,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in (*TMem)(unsafe.Pointer(pMem)).Fz = zOut (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).Fz) + goto translate_out translate_out: ; return SQLITE_OK @@ -97722,6 +97724,7 @@ func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc T for z < zEnd && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))])&int32(0x01) != 0 { z += uintptr(incr) } + goto do_atof_calc do_atof_calc: ; /* Zero is a special case */ @@ -97827,6 +97830,7 @@ do_atof_calc: if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } + goto atof_return atof_return: ; /* return true if number and no extra non-whitespace characters after */ @@ -100873,6 +100877,7 @@ func Xsqlite3_win32_set_directory8(tls *libc.TLS, type1 uint32, zValue uintptr) } else { rc = int32(SQLITE_ERROR) } + goto set_directory8_done set_directory8_done: ; Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) @@ -102286,6 +102291,7 @@ func _winOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { Xsqlite3_mutex_leave(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) return rc /* Jump here on any error */ + goto shm_open_err shm_open_err: ; _winShmSystemLock(tls, pShmNode, int32(WINSHM_UNLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) @@ -102588,6 +102594,7 @@ func _winShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, isWrit (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRegion++ } } + goto shmpage_out shmpage_out: ; if (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRegion > iRegion { @@ -104942,6 +104949,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint (*TMemStore)(unsafe.Pointer(pStore)).FmFlags = mFlags rc = SQLITE_OK } + goto end_deserialize end_deserialize: ; Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -105210,6 +105218,7 @@ func _sqlite3BitvecSet(tls *libc.TLS, p uintptr, i Tu32) (r int32) { /* we didn't find it in the hash. h points to the first */ /* available free spot. check to see if this is going to */ /* make our hash too "full". */ + goto bitvec_set_rehash bitvec_set_rehash: ; if uint64((*TBitvec)(unsafe.Pointer(p)).FnSet) >= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(4)/libc.Uint64FromInt32(2) { @@ -105238,6 +105247,7 @@ bitvec_set_rehash: return rc } } + goto bitvec_set_end bitvec_set_end: ; (*TBitvec)(unsafe.Pointer(p)).FnSet++ @@ -105470,6 +105480,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp))++ } /* Free allocated structure */ + goto bitvec_end bitvec_end: ; Xsqlite3_free(tls, pTmpSpace) @@ -106709,7 +106720,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { var p uintptr var v1, v2, v3, v4 int32 _, _, _, _, _ = p, v1, v2, v3, v4 - if _pcache1_g.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80) != 0 { if pBuf == uintptr(0) { v1 = libc.Int32FromInt32(0) n = v1 @@ -107230,7 +107241,7 @@ func _pcache1Init(tls *libc.TLS, NotUsed uintptr) (r int32) { _pcache1_g.FnInitPage = 0 } _pcache1_g.Fgrp.FmxPinned = uint32(10) - _pcache1_g.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+80, int32(1)) return SQLITE_OK } @@ -110727,6 +110738,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { } _sqlite3OsClose(tls, pSuper) rc = _sqlite3OsDelete(tls, pVfs, zSuper, 0) + goto delsuper_out delsuper_out: ; Xsqlite3_free(tls, zFree) @@ -111054,6 +111066,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { } } /*NOTREACHED*/ + goto end_playback end_playback: ; if rc == SQLITE_OK { @@ -112979,6 +112992,7 @@ _2: ** ** This branch also runs for files marked as immutable. */ + goto act_like_temp_file act_like_temp_file: ; tempFile = int32(1) @@ -113376,6 +113390,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { if int32((*TPager)(unsafe.Pointer(pPager)).FtempFile) == 0 && int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN && rc == SQLITE_OK { rc = _pagerPagecount(tls, pPager, pPager+32) } + goto failed failed: ; if rc != SQLITE_OK { @@ -113541,6 +113556,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f } } return SQLITE_OK + goto pager_acquire_err pager_acquire_err: ; if pPg != 0 { @@ -114423,6 +114439,7 @@ func _sqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, } } } + goto commit_phase_one_exit commit_phase_one_exit: ; if rc == SQLITE_OK && !((*TPager)(unsafe.Pointer(pPager)).FpWal != libc.UintptrFromInt32(0)) { @@ -116823,6 +116840,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { } Xsqlite3_free(tls, aFrame) } + goto finished finished: ; if rc == SQLITE_OK { @@ -116869,6 +116887,7 @@ finished: Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { @@ -126047,6 +126075,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh goto _1 _1: } + goto moveto_table_finish moveto_table_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -126205,6 +126234,7 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } return rc } + goto bypass_moveto_root bypass_moveto_root: ; for { @@ -126340,6 +126370,7 @@ bypass_moveto_root: goto _4 _4: } + goto moveto_index_finish moveto_index_finish: ; (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) @@ -126931,6 +126962,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) } } + goto end_allocate_page end_allocate_page: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -127083,6 +127115,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0)) _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage) + goto freepage_out freepage_out: ; if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -128095,6 +128128,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)))) = uint8((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(int64(aData))) >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(aData + uintptr(hdr+int32(5)) + 1)) = uint8(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(int64(aData))) return SQLITE_OK + goto editpage_fail editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ @@ -129158,6 +129192,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Cleanup before returning. */ + goto balance_cleanup balance_cleanup: ; _sqlite3DbFree(tls, uintptr(0), (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell) @@ -129842,6 +129877,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).FnKey = (*TBtreePayload)(unsafe.Pointer(pX)).FnKey } } + goto end_insert end_insert: ; return *(*int32)(unsafe.Pointer(bp)) @@ -130414,6 +130450,7 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int _zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData + uintptr(hdr))))|int32(PTF_LEAF)) } } + goto cleardatabasepage_out cleardatabasepage_out: ; _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -131262,6 +131299,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr _checkAppendMsg(tls, pCheck, __ccgo_ts+6070, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } + goto end_of_check end_of_check: ; if !(doCoverageCheck != 0) { @@ -131426,6 +131464,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } /* Clean up and report errors. */ + goto integrity_ck_cleanup integrity_ck_cleanup: ; _sqlite3PageFree(tls, (*(*TIntegrityCk)(unsafe.Pointer(bp))).Fheap) @@ -132544,6 +132583,7 @@ func _sqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) (r int32) } else { _sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*(*Tsqlite3_backup)(unsafe.Pointer(bp))).FpDest)) } + goto copy_finished copy_finished: ; _sqlite3BtreeLeave(tls, pFrom) @@ -133983,6 +134023,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++ } } + goto value_from_function_out value_from_function_out: ; if rc != SQLITE_OK { @@ -134149,6 +134190,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity } *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp)) return rc + goto no_mem no_mem: ; if pCtx == uintptr(0) || (*TParse)(unsafe.Pointer((*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0 { @@ -134824,6 +134866,7 @@ func _sqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr i++ } _sqlite3VdbeAddOp2(tls, p, int32(OP_ResultRow), iDest, i) + goto skip_op_resultrow skip_op_resultrow: ; _ = ap @@ -135199,6 +135242,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { } pOp -= 24 } + goto resolve_p2_values_loop_exit resolve_p2_values_loop_exit: ; if aLabel != 0 { @@ -138616,6 +138660,7 @@ func _vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 _, _, _, _, _, _ = aKey1, nCmp, nStr, res, szHdr, v1 aKey1 = pKey1 *(*int32)(unsafe.Pointer(bp)) = int32(int8(*(*Tu8)(unsafe.Pointer(aKey1 + 1)))) + goto vrcs_restart vrcs_restart: ; if *(*int32)(unsafe.Pointer(bp)) < int32(12) { @@ -138781,6 +138826,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr return SQLITE_OK /* Jump here if database corruption is detected after m has been ** allocated. Free the m object and return SQLITE_CORRUPT. */ + goto idx_rowid_corruption idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) @@ -139798,6 +139844,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { _, _ = db, rc db = (*TVdbe)(unsafe.Pointer(p)).Fdb if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_RUN_STATE) { + goto restart_step restart_step: ; if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_READY_STATE) { @@ -139895,6 +139942,7 @@ func _sqlite3Step(tls *libc.TLS, p uintptr) (r int32) { rc = (*TVdbe)(unsafe.Pointer(p)).Frc } } + goto end_of_step end_of_step: ; /* There are only a limited number of result codes allowed from the @@ -140270,6 +140318,7 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete return + goto failed failed: ; if xDelete != 0 { @@ -140652,6 +140701,7 @@ func _columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType ret = uintptr(0) } } + goto columnName_end columnName_end: ; Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -141378,6 +141428,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } } + goto preupdate_old_out preupdate_old_out: ; _sqlite3Error(tls, db, rc) @@ -141527,6 +141578,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } } *(*uintptr)(unsafe.Pointer(ppValue)) = pMem + goto preupdate_new_out preupdate_new_out: ; _sqlite3Error(tls, db, rc) @@ -142851,6 +142903,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _2: ; /* jump */ + goto jump_to_p2_and_check_for_interrupt jump_to_p2_and_check_for_interrupt: ; pOp = aOp + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp2-int32(1))*24 @@ -142864,6 +142917,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** way for performance, to avoid having to run the interrupt and progress ** checks on every opcode. This helps sqlite3_step() to run about 1.5% ** faster according to "valgrind --tool=cachegrind" */ + goto check_for_interrupt check_for_interrupt: ; if libc.AtomicLoadNInt32(db+432, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0 { @@ -142950,6 +143004,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* Most jump operations do a goto to this spot in order to update ** the pOp pointer. */ + goto jump_to_p2 jump_to_p2: ; /* There are never any jumps to instruction 0 */ @@ -143561,6 +143616,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(int32(int32(type1))&int32(int32(type2))&int32(MEM_Int) != 0) { goto _200 } + goto int_math int_math: ; iA = *(*Ti64)(unsafe.Pointer(pIn1)) @@ -143613,6 +143669,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if int32(int32(type1))&int32(int32(type2))&int32(MEM_Int) != 0 { goto int_math } + goto fp_math fp_math: ; rA = _sqlite3VdbeRealValue(tls, pIn1) @@ -143652,6 +143709,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _201: ; goto _187 + goto arithmetic_result_is_null arithmetic_result_is_null: ; _sqlite3VdbeMemSetNull(tls, pOut) @@ -144519,6 +144577,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* PseudoTable input register */ pC3 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) p22 = uint32((*TOp)(unsafe.Pointer(pOp)).Fp2) + goto op_column_restart op_column_restart: ; aOffset = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaOffset @@ -144645,6 +144704,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { zData = (*TVdbeCursor)(unsafe.Pointer(pC3)).FaRow } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + goto op_column_read_header op_column_read_header: ; i1 = int32((*TVdbeCursor)(unsafe.Pointer(pC3)).FnHdrParsed) @@ -144782,9 +144842,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } } + goto op_column_out op_column_out: ; goto _187 + goto op_column_corrupt op_column_corrupt: ; if (*(*TOp)(unsafe.Pointer(aOp))).Fp3 > 0 { @@ -144891,6 +144953,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i2++ } goto _187 + goto vdbe_type_error vdbe_type_error: ; _sqlite3VdbeError(tls, p, __ccgo_ts+6975, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) @@ -145854,6 +145917,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** and report database corruption if they were not, but this check has ** since moved into the btree layer. */ (*TVdbeCursor)(unsafe.Pointer(pCur)).FisTable = libc.BoolUint8(int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(8)) + goto open_cursor_set_hints open_cursor_set_hints: ; _sqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 48)), uint32(int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&(libc.Int32FromInt32(OPFLAG_BULKCSR)|libc.Int32FromInt32(OPFLAG_SEEKEQ)))) @@ -146290,6 +146354,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*int32)(unsafe.Pointer(bp + 112)) = _sqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC5 + 48))) } } + goto seek_not_found seek_not_found: ; if *(*int32)(unsafe.Pointer(bp + 112)) != 0 { @@ -146395,6 +146460,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !(*(*int32)(unsafe.Pointer(bp + 160)) > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == 0) { goto _259 } + goto seekscan_search_fail seekscan_search_fail: ; /* Jump to SeekGE.P2, ending the loop */ @@ -146705,6 +146771,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 iKey1 = uint64(*(*Ti64)(unsafe.Pointer(pIn3))) + goto notExistsWithKey notExistsWithKey: ; pC10 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -147472,6 +147539,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ; /* jump, ncycle */ pC22 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) rc = _sqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC22 + 48)), (*TOp)(unsafe.Pointer(pOp)).Fp3) + goto next_tail next_tail: ; (*TVdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = uint32(CACHE_STALE) @@ -149592,6 +149660,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If we reach this point, it means that execution is finished with ** an error of some kind. */ + goto abort_due_to_error abort_due_to_error: ; if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -149623,6 +149692,7 @@ abort_due_to_error: /* This is the only way out of this procedure. We have to ** release the mutexes on btrees that were acquired at the ** top. */ + goto vdbe_return vdbe_return: ; for nVmStep >= nProgressLimit && (*Tsqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0) { @@ -149641,6 +149711,7 @@ vdbe_return: /* Jump to here if a string or blob larger than SQLITE_MAX_LENGTH ** is encountered. */ + goto too_big too_big: ; _sqlite3VdbeError(tls, p, __ccgo_ts+6732, 0) @@ -149648,6 +149719,7 @@ too_big: goto abort_due_to_error /* Jump to here if a malloc() fails. */ + goto no_mem no_mem: ; _sqlite3OomFault(tls, db) @@ -149657,6 +149729,7 @@ no_mem: /* Jump to here if the sqlite3_interrupt() API sets the interrupt ** flag. */ + goto abort_due_to_interrupt abort_due_to_interrupt: ; rc = int32(SQLITE_INTERRUPT) @@ -150052,6 +150125,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } _sqlite3ParseObjectReset(tls, bp+8) } + goto blob_open_out blob_open_out: ; if rc == SQLITE_OK && int32((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -154969,6 +155043,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(uint8(eNewExprOp)) + goto lookupname_end lookupname_end: ; if cnt == int32(1) { @@ -158764,6 +158839,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, ** the RHS and LHS sizes match during code generation. */ (*TExpr)(unsafe.Pointer(pFirst)).FiTable = (*TIdList)(unsafe.Pointer(pColumns)).FnId } + goto vector_append_error vector_append_error: ; _sqlite3ExprUnmapAndDelete(tls, pParse, pExpr) @@ -160740,11 +160816,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } /* Jumps here in order to return true. */ _sqlite3VdbeJumpHere(tls, v, addrTruthOp) + goto sqlite3ExprCodeIN_finished sqlite3ExprCodeIN_finished: ; if rLhs != rLhsOrig { _sqlite3ReleaseTempReg(tls, pParse, rLhs) } + goto sqlite3ExprCodeIN_oom_error sqlite3ExprCodeIN_oom_error: ; _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) @@ -161268,6 +161346,7 @@ func _sqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target *(*int32)(unsafe.Pointer(bp)) = 0 /* If non-zero free this temporary register */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Temporary expression node */ p5 = 0 + goto expr_code_doover expr_code_doover: ; if pExpr == uintptr(0) { @@ -162351,6 +162430,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsTrue)) == uint32(EP_IsTrue) { @@ -162556,6 +162636,7 @@ _16: goto _18 _17: ; + goto default_expr default_expr: ; if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) { @@ -163511,6 +163592,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, *(*Tu16)(unsafe.Pointer(v4))++ (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) } + goto fix_up_expr fix_up_expr: ; (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo @@ -164111,6 +164193,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11228, 0) + goto exit_rename_table exit_rename_table: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -164353,6 +164436,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pTab + 64))).FaddColOffset + goto exit_begin_add_column exit_begin_add_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -164469,6 +164553,7 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11228, int32(1)) + goto exit_rename_column exit_rename_column: ; _sqlite3SrcListDelete(tls, db, pSrc) @@ -165606,6 +165691,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) + goto renameColumnFunc_done renameColumnFunc_done: ; if rc != SQLITE_OK { @@ -166121,6 +166207,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12555, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(int64(zSql)), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) + goto drop_column_done drop_column_done: ; _renameParseCleanup(tls, bp) @@ -166285,6 +166372,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), iCur, addr+int32(1)) _sqlite3VdbeJumpHere(tls, v, addr) } + goto exit_drop_column exit_drop_column: ; _sqlite3DbFree(tls, db, zCol) @@ -167037,6 +167125,7 @@ func _sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { (*TStatAccum)(unsafe.Pointer(p)).FnSample++ /* Zero the first nEqZero entries in the anEq[] array. */ libc.Xmemset(tls, (*TStatSample)(unsafe.Pointer(pSample)).FanEq, 0, uint64(8)*uint64(uint64(nEqZero))) + goto find_new_min find_new_min: ; if (*TStatAccum)(unsafe.Pointer(p)).FnSample >= (*TStatAccum)(unsafe.Pointer(p)).FmxSample { @@ -168787,6 +168876,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { goto attach_error } return + goto attach_error attach_error: ; /* Return an error if we get here */ @@ -168867,6 +168957,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) _sqlite3CollapseDatabaseArray(tls, db) return + goto detach_error detach_error: ; Xsqlite3_result_error(tls, context, bp, -int32(1)) @@ -168921,6 +169012,7 @@ func _codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAut */ _sqlite3VdbeAddOp1(tls, v, int32(OP_Expire), libc.BoolInt32(type1 == int32(SQLITE_ATTACH))) } + goto attach_end attach_end: ; _sqlite3ExprDelete(tls, db, pFilename) @@ -170998,6 +171090,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Normal (non-error) return. */ return /* If an error occurs, we jump here */ + goto begin_table_error begin_table_error: ; (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) @@ -171556,6 +171649,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pList = uintptr(0) } } + goto primary_key_exit primary_key_exit: ; _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) @@ -171704,9 +171798,11 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui _sqlite3ColumnSetExpr(tls, pParse, pTab, pCol, pExpr) pExpr = uintptr(0) goto generated_done + goto generated_error generated_error: ; _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14368, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + goto generated_done generated_done: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -172877,6 +172973,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui (*(*TToken)(unsafe.Pointer(bp))).Fn = uint32(1) /* Use sqlite3EndTable() to add the view to the schema table */ _sqlite3EndTable(tls, pParse, uintptr(0), bp, uint32(0), uintptr(0)) + goto create_view_fail create_view_fail: ; _sqlite3SelectDelete(tls, db, pSelect) @@ -173417,6 +173514,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) } + goto exit_drop_table exit_drop_table: ; _sqlite3SrcListDelete(tls, db, pName) @@ -173580,6 +173678,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p FpDfltList uintptr })(unsafe.Pointer(p + 64))).FpFKey = pFKey pFKey = uintptr(0) + goto fk_end fk_end: ; _sqlite3DbFree(tls, db, pFKey) @@ -174344,6 +174443,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } } /* Clean up before exiting */ + goto exit_create_index exit_create_index: ; if pIndex != 0 { @@ -174529,6 +174629,7 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) } + goto exit_drop_index exit_drop_index: ; _sqlite3SrcListDelete(tls, db, pName) @@ -174987,6 +175088,7 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa } } return p + goto append_from_error append_from_error: ; _sqlite3ClearOnOrUsing(tls, db, pOnUsing) @@ -176990,6 +177092,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if memCnt != 0 { _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+16523) } + goto delete_from_cleanup delete_from_cleanup: ; _sqlite3AuthContextPop(tls, bp+8) @@ -177652,11 +177755,13 @@ func _instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } Xsqlite3_result_int(tls, context, N) + goto endInstr endInstr: ; Xsqlite3_value_free(tls, pC1) Xsqlite3_value_free(tls, pC2) return + goto endInstrOOM endInstrOOM: ; Xsqlite3_result_error_nomem(tls, context) @@ -178960,10 +179065,12 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { *(*Tu8)(unsafe.Pointer(v6)) = uint8(int32(_sqlite3HexToInt(tls, int32(int32(c))))<flags */ @@ -209099,6 +209226,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** to the results of the OUTER JOIN. The following loop generates the ** appropriate WHERE clause constraint checks. tag-20220513a. */ + goto code_outer_join_constraints code_outer_join_constraints: ; pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -211565,6 +211693,7 @@ func _whereOrInsert(tls *libc.TLS, pSet uintptr, prereq TBitmask, rRun TLogEst, return 0 } } + goto whereOrInsert_done whereOrInsert_done: ; (*TWhereOrCost)(unsafe.Pointer(p)).Fprereq = prereq @@ -212440,6 +212569,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea _sqlite3ReleaseTempReg(tls, pParse, regRecord) /* Jump here when skipping the initialization */ _sqlite3VdbeJumpHere(tls, v, addrInit) + goto end_auto_index_create end_auto_index_create: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPartial) @@ -217927,6 +218057,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = _sqlite3VdbeCurrentAddr(tls, v) return pWInfo /* Jump here if malloc fails */ + goto whereBeginError whereBeginError: ; if pWInfo != 0 { @@ -218507,6 +218638,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = nArg _ = apArg return + goto error_out error_out: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23882, -int32(1)) @@ -219732,6 +219864,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 (*TWindow)(unsafe.Pointer(pWin)).FpEnd = _sqlite3WindowOffsetExpr(tls, pParse, pEnd) (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3WindowOffsetExpr(tls, pParse, pStart) return pWin + goto windowAllocErr windowAllocErr: ; _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pEnd) @@ -234831,7 +234964,6 @@ func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { // ** without blocking. // */ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { -ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() var pMainMtx uintptr var rc int32 _, _ = pMainMtx, rc /* Result code */ @@ -234843,7 +234975,7 @@ ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() ** must be complete. So isInit must not be set until the very end ** of this routine. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { _sqlite3MemoryBarrier(tls) return SQLITE_OK } @@ -234904,7 +235036,7 @@ ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() ** call to sqlite3PcacheInitialize(). */ Xsqlite3_mutex_enter(tls, _sqlite3Config.FpInitMutex) - if _sqlite3Config.FisInit == 0 && _sqlite3Config.FinProgress == 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) == 0 && _sqlite3Config.FinProgress == 0 { _sqlite3Config.FinProgress = int32(1) libc.Xmemset(tls, uintptr(unsafe.Pointer(&_sqlite3BuiltinFunctions)), 0, uint64(184)) _sqlite3RegisterBuiltinFunctions(tls) @@ -234921,7 +235053,7 @@ ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() if rc == SQLITE_OK { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.FpPage, _sqlite3Config.FszPage, _sqlite3Config.FnPage) _sqlite3MemoryBarrier(tls) - _sqlite3Config.FisInit = int32(1) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, int32(1)) } _sqlite3Config.FinProgress = 0 } @@ -234946,7 +235078,7 @@ ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() */ /* Experimentally determine if high-precision floating point is ** available. */ - _sqlite3Config.FbUseLongDouble = uint8(_hasHighPrecisionDouble(tls, rc)) + // disabled return rc } @@ -234961,10 +235093,10 @@ ng := runtime.GOMAXPROCS(1); defer func() { runtime.GOMAXPROCS(ng) }() // ** when this routine is invoked, then this routine is a harmless no-op. // */ func Xsqlite3_shutdown(tls *libc.TLS) (r int32) { - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { Xsqlite3_os_end(tls) Xsqlite3_reset_auto_extension(tls) - _sqlite3Config.FisInit = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340, 0) } if _sqlite3Config.FisPCacheInit != 0 { _sqlite3PcacheShutdown(tls) @@ -235012,7 +235144,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { ** the SQLite library is in use. Except, a few selected opcodes ** are allowed. */ - if _sqlite3Config.FisInit != 0 { + if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)< (*TJsonString)(unsafe.Pointer(p)).FnAlloc && _jsonStringGrow(tls, p, N+uint32(3)) != 0 { @@ -241551,6 +241688,7 @@ func _json5Whitespace(tls *libc.TLS, zIn uintptr) (r int32) { goto whitespace_done } } + goto whitespace_done whitespace_done: ; return n @@ -242203,6 +242341,7 @@ func _jsonTranslateTextToBlob(tls *libc.TLS, pParse uintptr, i Tu32) (r int32) { var _ /* op at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cDelim, iBlob, iStart, iThis, j, k, k1, nn, opcode, seenE, t, x, z, v40, v41, v43, v44, v46, v48 z = (*TJsonParse)(unsafe.Pointer(pParse)).FzJson + goto json_parse_restart json_parse_restart: ; switch int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))) { @@ -242357,6 +242496,7 @@ _1: } j = (*TJsonParse)(unsafe.Pointer(pParse)).FiErr + uint32(1) } + goto parse_object_value parse_object_value: ; x = _jsonTranslateTextToBlob(tls, pParse, j) @@ -242483,6 +242623,7 @@ _3: ; /* Parse string */ opcode = uint8(JSONB_TEXT) + goto parse_string parse_string: ; cDelim = *(*int8)(unsafe.Pointer(z + uintptr(i))) @@ -242600,6 +242741,7 @@ _8: ; /* Parse number */ t = uint8(0x00) /* Bit 0x01: JSON5. Bit 0x02: FLOAT */ + goto parse_number parse_number: ; seenE = uint8(0) @@ -242677,6 +242819,7 @@ parse_number: } } } + goto parse_number_2 parse_number_2: ; j = i + uint32(1) @@ -242735,6 +242878,7 @@ parse_number_2: return -int32(1) } } + goto parse_number_finish parse_number_finish: ; if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('+') { @@ -243271,6 +243415,7 @@ _14: goto _16 _15: ; + goto malformed_jsonb malformed_jsonb: ; p29 = pOut + 33 @@ -244107,6 +244252,7 @@ _6: if *(*Tu32)(unsafe.Pointer(bp)) == uint32(0) { goto returnfromblob_malformed } + goto to_double to_double: ; z1 = _sqlite3DbStrNDup(tls, db, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(int32(*(*Tu32)(unsafe.Pointer(bp))))) @@ -244225,10 +244371,12 @@ _14: _15: ; return + goto returnfromblob_oom returnfromblob_oom: ; Xsqlite3_result_error_nomem(tls, pCtx) return + goto returnfromblob_malformed returnfromblob_malformed: ; Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26269, -int32(1)) @@ -244438,6 +244586,7 @@ func _jsonInsertIntoBlob(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr, e _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto jsonInsertIntoBlob_patherror jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) @@ -244526,6 +244675,7 @@ func _jsonParseFuncArg(tls *libc.TLS, ctx uintptr, pArg uintptr, flgs Tu32) (r u } } db = Xsqlite3_context_db_handle(tls, ctx) + goto rebuild_from_cache rebuild_from_cache: ; p = _sqlite3DbMallocZero(tls, db, uint64(72)) @@ -244615,6 +244765,7 @@ rebuild_from_cache: } } return p + goto json_pfa_malformed json_pfa_malformed: ; if flgs&uint32(JSON_KEEPERROR) != 0 { @@ -244625,6 +244776,7 @@ json_pfa_malformed: Xsqlite3_result_error(tls, ctx, __ccgo_ts+26269, -int32(1)) return uintptr(0) } + goto json_pfa_oom json_pfa_oom: ; _jsonParseFree(tls, pFromCache) @@ -244963,6 +245115,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } } + goto json_extract_error json_extract_error: ; _jsonStringReset(tls, bp) @@ -245330,9 +245483,11 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _jsonReturnParse(tls, ctx, p) _jsonParseFree(tls, p) return + goto json_remove_patherror json_remove_patherror: ; _jsonBadPathError(tls, ctx, zPath) + goto json_remove_done json_remove_done: ; _jsonParseFree(tls, p) @@ -245442,6 +245597,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { i = uint32(0) } Xsqlite3_result_text(tls, ctx, _jsonbType[int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob + uintptr(i))))&int32(0x0f)], -int32(1), libc.UintptrFromInt32(0)) + goto json_type_done json_type_done: ; _jsonParseFree(tls, p) @@ -246530,6 +246686,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent))).FiValue = i } return SQLITE_OK + goto json_each_malformed_input json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) @@ -249821,6 +249978,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe rc = _nodeRelease(tls, pRtree, pLeft) pLeft = uintptr(0) } + goto splitnode_out splitnode_out: ; _nodeRelease(tls, pRtree, pRight) @@ -250426,6 +250584,7 @@ func _rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRow rc = Xsqlite3_reset(tls, pUp) } } + goto constraint constraint: ; _rtreeRelease(tls, pRtree) @@ -250974,6 +251133,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto rtreeInit_fail rtreeInit_fail: ; if rc == SQLITE_OK { @@ -251958,6 +252118,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { rc = int32(SQLITE_ERROR) } } + goto parse_json_err parse_json_err: ; if pRc != 0 { @@ -252465,6 +252626,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, if !(aCoord == uintptr(0)) { goto _6 } + goto geopolyBboxFill geopolyBboxFill: ; pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*uint64(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) @@ -252568,8 +252730,8 @@ func _geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if pBBox == uintptr(0) { return } - if (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 { - (*TGeoBBox)(unsafe.Pointer(pBBox)).FisInit = int32(1) + if libc.AtomicLoadPInt32(pBBox) == 0 { + libc.AtomicStorePInt32(pBBox, int32(1)) libc.Xmemcpy(tls, pBBox+4, bp, libc.Uint64FromInt64(4)*libc.Uint64FromInt32(4)) } else { if *(*TRtreeValue)(unsafe.Pointer(bp)) < *(*TRtreeValue)(unsafe.Pointer(pBBox + 4)) { @@ -253196,6 +253358,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { } } } + goto geopolyOverlapDone geopolyOverlapDone: ; Xsqlite3_free(tls, p) @@ -253336,6 +253499,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree return SQLITE_OK + goto geopolyInit_fail geopolyInit_fail: ; if rc == SQLITE_OK { @@ -253484,6 +253648,7 @@ func _geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uin *(*int32)(unsafe.Pointer(bp + 8)) = _rtreeStepToLeaf(tls, pCsr) } } + goto geopoly_filter_end geopoly_filter_end: ; _nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp))) @@ -253766,6 +253931,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, pUp) } } + goto geopoly_update_end geopoly_update_end: ; _rtreeRelease(tls, pRtree) @@ -255898,6 +256064,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu } *(*int32)(unsafe.Pointer(peType)) = int32(RBU_PK_NONE) } + goto rbuTableType_end rbuTableType_end: ; i = uint32(0) @@ -256337,6 +256504,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } + goto index_start_out index_start_out: ; Xsqlite3_free(tls, zOrder) @@ -260842,6 +261010,7 @@ func _statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) (r int32) { } } return SQLITE_OK + goto statPageIsCorrupt statPageIsCorrupt: ; (*TStatPage)(unsafe.Pointer(p)).Fflags = uint8(0) @@ -260932,6 +261101,7 @@ func _statNext(tls *libc.TLS, pCursor uintptr) (r int32) { pPager = _sqlite3BtreePager(tls, pBt) Xsqlite3_free(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath) (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = uintptr(0) + goto statNextRestart statNextRestart: ; if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage < 0 { @@ -263402,6 +263572,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u } } /* If an error has occurred, mark the session object as failed. */ + goto error_out error_out: ; if (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 != 0 { @@ -263890,6 +264061,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } Xsqlite3_free(tls, zExpr) } + goto diff_out diff_out: ; _sessionPreupdateHooks(tls, pSession) @@ -266019,6 +266191,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } + goto finished_invert finished_invert: ; Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) @@ -273524,6 +273697,7 @@ func _fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid Ti64, pBuf uintpt *(*int32)(unsafe.Pointer(pn)) = (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn } } + goto synonym_poslist_out synonym_poslist_out: ; if aIter != bp { @@ -273656,6 +273830,7 @@ func _fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMat i++ } } + goto ismatch_out ismatch_out: ; *(*int32)(unsafe.Pointer(pbMatch)) = libc.BoolInt32((*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) @@ -273862,6 +274037,7 @@ func _fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) (r int32) { goto ismatch_out } } + goto ismatch_out ismatch_out: ; bRet = libc.BoolInt32((*TFts5Buffer)(unsafe.Pointer((*(*TFts5NearTrimmer)(unsafe.Pointer(a))).FpOut)).Fn > 0) @@ -279365,6 +279541,7 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui } _fts5SegIterLoadNPos(tls, p, pIter) return + goto next_none_eof next_none_eof: ; _fts5DataRelease(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -279727,6 +279904,7 @@ func _fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uin *(*Tu32)(unsafe.Pointer(bp)) += uint32(_sqlite3Fts5GetVarint32(tls, a+uintptr(*(*Tu32)(unsafe.Pointer(bp))), bp+4)) } } + goto search_failed search_failed: ; if bGe == 0 { @@ -279758,6 +279936,7 @@ search_failed: } } } + goto search_success search_success: ; if int64(*(*Tu32)(unsafe.Pointer(bp)))+int64(*(*Tu32)(unsafe.Pointer(bp + 8))) > int64(int64(n)) || *(*Tu32)(unsafe.Pointer(bp + 8)) < uint32(1) { @@ -280962,6 +281141,7 @@ func _fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { iPrevOut = iPrev } } + goto setoutputs_col_out setoutputs_col_out: ; (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*TFts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp @@ -281179,6 +281359,7 @@ func _fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, p _fts5MultiIterFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) } + goto fts5MultiIterNew_post_check fts5MultiIterNew_post_check: ; return @@ -287305,6 +287486,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } } + goto filter_out filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -291050,6 +291232,7 @@ _6: if !(_fts5UnicodeIsAlnum(tls, p, int32(int32(iCode))) != 0 || _sqlite3Fts5UnicodeIsdiacritic(tls, int32(int32(iCode))) != 0) { goto _12 } + goto non_ascii_tokenchar non_ascii_tokenchar: ; iCode = uint32(_sqlite3Fts5UnicodeFold(tls, int32(int32(iCode)), (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic)) @@ -291111,6 +291294,7 @@ _8: goto _25 _24: ; + goto ascii_tokenchar ascii_tokenchar: ; if int32(*(*uint8)(unsafe.Pointer(zCsr))) >= int32('A') && int32(*(*uint8)(unsafe.Pointer(zCsr))) <= int32('Z') { @@ -291136,6 +291320,7 @@ _5: goto _2 _1: ; + goto tokenize_done tokenize_done: ; if rc == int32(SQLITE_DONE) { @@ -291882,6 +292067,7 @@ func _fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nT *(*int32)(unsafe.Pointer(bp))-- } return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp)), iStart, iEnd) + goto pass_through pass_through: ; return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterContext)(unsafe.Pointer(p)).FxToken})))(tls, (*TPorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd) diff --git a/vendor/modules.txt b/vendor/modules.txt index ef9048bd18..c929e1433a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1171,7 +1171,7 @@ modernc.org/mathutil # modernc.org/memory v1.8.0 ## explicit; go 1.18 modernc.org/memory -# modernc.org/sqlite v1.29.9 +# modernc.org/sqlite v1.29.10 ## explicit; go 1.20 modernc.org/sqlite modernc.org/sqlite/lib